-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(auth-mock): 사용자 mock 변수 이름 변경하고 id 생성 함수 정의한다 (#413)
- Loading branch information
Showing
3 changed files
with
26 additions
and
23 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,20 +1,23 @@ | ||
import type { Member } from '@/lib/api/auth'; | ||
|
||
export const myAccount: Omit<Member, 'password'> = { | ||
id: -1, | ||
email: 'dev-email@toquiz.com', | ||
nickname: 'dev-nickname', | ||
provider: 'LOCAL', | ||
createdAt: new Date().toString(), | ||
updatedAt: new Date().toString(), | ||
}; | ||
|
||
let id = 0; | ||
export const createMockUserId = (() => { | ||
let id = 0; | ||
return () => id++; | ||
})(); | ||
export const createMockUser = (): Omit<Member, 'password'> => ({ | ||
id: id++, | ||
email: '테스트 이메일', | ||
id: createMockUserId(), | ||
email: 'test@email.com', | ||
nickname: '테스트 닉네임', | ||
provider: 'TEST', | ||
createdAt: new Date().toString(), | ||
updatedAt: new Date().toString(), | ||
}); | ||
|
||
export const mockUser: Omit<Member, 'password'> = { | ||
id: createMockUserId(), | ||
email: 'dev-email@toquiz.com', | ||
nickname: 'dev-nickname', | ||
provider: 'LOCAL', | ||
createdAt: new Date().toString(), | ||
updatedAt: new Date().toString(), | ||
}; |
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