-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
1,319 additions
and
1,717 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18.18.0 | ||
v20.17.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { faker } from '@faker-js/faker'; | ||
|
||
import { | ||
GroupBookmark, | ||
GroupBookmarkConstructorParams, | ||
} from '@sight/app/domain/group/model/GroupBookmark'; | ||
|
||
function generator( | ||
params: Partial<GroupBookmarkConstructorParams> = {}, | ||
): GroupBookmark { | ||
return new GroupBookmark({ | ||
id: faker.string.uuid(), | ||
userId: faker.string.uuid(), | ||
groupId: faker.string.uuid(), | ||
createdAt: faker.date.anytime(), | ||
...params, | ||
}); | ||
} | ||
|
||
function normal( | ||
params: Partial< | ||
Pick<GroupBookmarkConstructorParams, 'userId' | 'groupId'> | ||
> = {}, | ||
): GroupBookmark { | ||
return generator(params); | ||
} | ||
|
||
export const GroupBookmarkFixture = { | ||
raw: generator, | ||
normal, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { faker } from '@faker-js/faker'; | ||
import { | ||
CUSTOMER_SERVICE_GROUP_ID, | ||
GroupAccessGrade, | ||
GroupCategory, | ||
GroupState, | ||
PRACTICE_GROUP_ID, | ||
} from '@sight/app/domain/group/model/constant'; | ||
|
||
import { | ||
Group, | ||
GroupConstructorParams, | ||
} from '@sight/app/domain/group/model/Group'; | ||
|
||
function generator(params: Partial<GroupConstructorParams> = {}): Group { | ||
return new Group({ | ||
id: faker.string.uuid(), | ||
category: faker.helpers.enumValue(GroupCategory), | ||
state: faker.helpers.enumValue(GroupState), | ||
title: faker.lorem.word(), | ||
authorUserId: faker.string.uuid(), | ||
adminUserId: faker.string.uuid(), | ||
purpose: faker.lorem.sentence(), | ||
interestIds: [faker.string.uuid()], | ||
technology: [faker.lorem.word()], | ||
grade: faker.helpers.enumValue(GroupAccessGrade), | ||
lastUpdaterUserId: faker.string.uuid(), | ||
repository: faker.internet.url(), | ||
allowJoin: faker.datatype.boolean(), | ||
hasPortfolio: faker.datatype.boolean(), | ||
createdAt: faker.date.anytime(), | ||
updatedAt: faker.date.anytime(), | ||
...params, | ||
}); | ||
} | ||
|
||
function inProgressJoinable( | ||
params: Partial<GroupConstructorParams> = {}, | ||
): Group { | ||
return generator({ | ||
state: GroupState.PROGRESS, | ||
grade: GroupAccessGrade.MEMBER, | ||
allowJoin: true, | ||
...params, | ||
}); | ||
} | ||
|
||
function suspended(params: Partial<GroupConstructorParams> = {}): Group { | ||
return generator({ | ||
state: GroupState.SUSPEND, | ||
...params, | ||
}); | ||
} | ||
|
||
function successfullyEnd(params: Partial<GroupConstructorParams> = {}): Group { | ||
return generator({ | ||
state: GroupState.END_SUCCESS, | ||
...params, | ||
}); | ||
} | ||
|
||
function customerService(params: Partial<GroupConstructorParams> = {}): Group { | ||
return generator({ | ||
id: CUSTOMER_SERVICE_GROUP_ID, | ||
...params, | ||
}); | ||
} | ||
|
||
function practice(params: Partial<GroupConstructorParams> = {}): Group { | ||
return generator({ | ||
id: PRACTICE_GROUP_ID, | ||
...params, | ||
}); | ||
} | ||
|
||
export const GroupFixture = { | ||
raw: generator, | ||
inProgressJoinable, | ||
successfullyEnd, | ||
suspended, | ||
customerService, | ||
practice, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.