Skip to content

Commit

Permalink
chore: Add constants for OAuth agents and update user faker
Browse files Browse the repository at this point in the history
  • Loading branch information
timepresent95 committed Aug 20, 2024
1 parent 5984c8d commit 2dbbdfe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/mocks/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './oauth';
9 changes: 9 additions & 0 deletions src/mocks/constants/oauth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {OAuthAgent} from '@/types';

export const oauthAgents: OAuthAgent[] = [
'NATIVE',
'GOOGLE',
'NAVER',
'KAKAO',
'APPLE',
];
13 changes: 6 additions & 7 deletions src/mocks/fakers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ import {faker} from '@faker-js/faker';

import {getRandom} from './util';

import {birthType, roles} from '@/constants';
import type {Member} from '@/types';
import {birthType} from '@/constants';
import {oauthAgents} from '@/mocks/constants';
import type {UserInfo} from '@/types';
import {formatDate} from '@/utils';

export function createUser(isHost: boolean): Member {
export function createUser(): UserInfo {
return {
nickName: faker.person.fullName(),
groupRole: getRandom(roles),
birth: formatDate(faker.date.birthdate()),
birthType: getRandom(birthType),
email: faker.internet.email(),
signUpDate: faker.date.past(),
isHost,
OAuthProvider: getRandom(oauthAgents),
createAt: faker.date.past(),
};
}

0 comments on commit 2dbbdfe

Please sign in to comment.