-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: get event, get mentor mock * refactor: mock 폴더 구조 변경 * refactor: mock index 추가 * refactor: 이벤트 더미데이터 분리 * fix: 페이지 로더 적용 해제 * fix: 페이지 데이터 개수 수정
- Loading branch information
1 parent
655cbb6
commit 9248b23
Showing
11 changed files
with
199 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,119 @@ | ||
import { ReadEvent } from '~/types/event/event'; | ||
import { EventList } from '~/types/event/eventList'; | ||
import { PageData } from '~/types/pageData'; | ||
|
||
const pageDataMock: PageData = { | ||
first: true, | ||
last: false, | ||
number: 0, | ||
size: 9, | ||
sort: { | ||
empty: true, | ||
sorted: false, | ||
unsorted: true, | ||
}, | ||
totalPages: 5, | ||
totalElements: 4, | ||
}; | ||
|
||
export const readEventMock0: ReadEvent = { | ||
id: 0, | ||
mentorId: 0, | ||
title: '웹 개발자 이력서 5일 간 첨삭', | ||
content: '프론트, 백 관계 없이 웹 개발을 희망하시는 분들 이력서 피드백 드릴게요', | ||
maximumCount: 3, | ||
currentApplicantCount: 1, | ||
status: 'OPEN', | ||
positions: ['FRONT', 'BACK'], | ||
timeInfo: { | ||
openDateTime: '2024-04-24T08:00:00.000Z', | ||
closeDateTime: '2024-04-30T23:59:59.999Z', | ||
endDate: '2024-05-01T23:59:59.999Z', | ||
}, | ||
}; | ||
|
||
export const readEventMock1: ReadEvent = { | ||
id: 1, | ||
mentorId: 0, | ||
title: 'AI 이력서 첨삭', | ||
content: 'AI 개발을 희망하시는 분들 이력서 피드백 드릴게요', | ||
maximumCount: 2, | ||
currentApplicantCount: 0, | ||
status: 'OPEN', | ||
positions: ['ML_AI'], | ||
timeInfo: { | ||
openDateTime: '2024-04-24T08:00:00.000Z', | ||
closeDateTime: '2024-04-30T23:59:59.999Z', | ||
endDate: '2024-05-01T23:59:59.999Z', | ||
}, | ||
}; | ||
|
||
export const readEventMock2: ReadEvent = { | ||
id: 2, | ||
mentorId: 0, | ||
title: '데브옵스 이력서 첨삭', | ||
content: '데브옵스 개발을 희망하시는 분들 이력서 피드백 드릴게요', | ||
maximumCount: 1, | ||
currentApplicantCount: 0, | ||
status: 'OPEN', | ||
positions: ['DEVOPS'], | ||
timeInfo: { | ||
openDateTime: '2024-04-24T08:00:00.000Z', | ||
closeDateTime: '2024-04-30T23:59:59.999Z', | ||
endDate: '2024-05-01T23:59:59.999Z', | ||
}, | ||
}; | ||
|
||
export const readEventMock3: ReadEvent = { | ||
id: 3, | ||
mentorId: 0, | ||
title: '모바일 개발자 이력서 첨삭', | ||
content: '모바일 개발을 희망하시는 분들 이력서 피드백 드릴게요', | ||
maximumCount: 1, | ||
currentApplicantCount: 0, | ||
status: 'OPEN', | ||
positions: ['MOBILE'], | ||
timeInfo: { | ||
openDateTime: '2024-04-24T08:00:00.000Z', | ||
closeDateTime: '2024-04-30T23:59:59.999Z', | ||
endDate: '2024-05-01T23:59:59.999Z', | ||
}, | ||
}; | ||
|
||
export const eventListMock: EventList = { | ||
events: [ | ||
{ | ||
info: readEventMock0, | ||
mentorInfo: { | ||
mentorId: 0, | ||
nickname: '윤지석', | ||
imageUrl: '', | ||
}, | ||
}, | ||
{ | ||
info: readEventMock1, | ||
mentorInfo: { | ||
mentorId: 0, | ||
nickname: '윤지석', | ||
imageUrl: '', | ||
}, | ||
}, | ||
{ | ||
info: readEventMock2, | ||
mentorInfo: { | ||
mentorId: 0, | ||
nickname: '윤지석', | ||
imageUrl: '', | ||
}, | ||
}, | ||
{ | ||
info: readEventMock3, | ||
mentorInfo: { | ||
mentorId: 0, | ||
nickname: '윤지석', | ||
imageUrl: '', | ||
}, | ||
}, | ||
], | ||
pageData: pageDataMock, | ||
}; |
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,26 @@ | ||
import { HttpResponse, http } from 'msw'; | ||
import { | ||
eventListMock, | ||
readEventMock1, | ||
readEventMock2, | ||
readEventMock0, | ||
readEventMock3, | ||
} from './event.mock'; | ||
import { environments } from '~/config/environments'; | ||
|
||
const allEvents = new Map(); | ||
allEvents.set('0', readEventMock0); | ||
allEvents.set('1', readEventMock1); | ||
allEvents.set('2', readEventMock2); | ||
allEvents.set('3', readEventMock3); | ||
|
||
export const handlers = [ | ||
http.get(`${environments.baseUrlEnv()}/v1/events`, () => { | ||
return HttpResponse.json(eventListMock); | ||
}), | ||
http.get(`${environments.baseUrlEnv()}/v1/events/:id`, ({ params }) => { | ||
const { id } = params; | ||
const event = allEvents.get(id); | ||
return HttpResponse.json(event); | ||
}), | ||
]; |
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,3 @@ | ||
import { handlers } from './event'; | ||
|
||
export { handlers as eventHandlers }; |
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,5 @@ | ||
import { eventHandlers } from './event'; | ||
import { resumeHandlers } from './resume'; | ||
import { userHandlers } from './user'; | ||
|
||
export const handlers = [...eventHandlers, ...resumeHandlers, ...userHandlers]; |
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,3 @@ | ||
import { handlers } from './resume'; | ||
|
||
export { handlers as resumeHandlers }; |
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,8 @@ | ||
import { HttpResponse, http } from 'msw'; | ||
import { environments } from '~/config/environments'; | ||
|
||
export const handlers = [ | ||
http.post(`${environments.baseUrlEnv()}/v1/resumes`, () => { | ||
return HttpResponse.json(); | ||
}), | ||
]; |
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,3 @@ | ||
import { handlers } from './user'; | ||
|
||
export { handlers as userHandlers }; |
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,19 @@ | ||
import { HttpResponse, http } from 'msw'; | ||
import { environments } from '~/config/environments'; | ||
import { ReadMentor } from '~/types/mentor'; | ||
|
||
const mentorMock: ReadMentor = { | ||
nickname: '윤지석', | ||
experiencedPositions: ['BACK', 'FRONT'], | ||
careerContent: '', | ||
careerYear: 4, | ||
introduce: '', | ||
imageUrl: '', | ||
role: 'mentor', | ||
}; | ||
|
||
export const handlers = [ | ||
http.get(`${environments.baseUrlEnv()}/v1/mentors/:id`, () => { | ||
return HttpResponse.json(mentorMock); | ||
}), | ||
]; |
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