-
Notifications
You must be signed in to change notification settings - Fork 8
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
7 changed files
with
114 additions
and
26 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,4 +1,4 @@ | ||
import { setupWorker } from "msw/browser"; | ||
import missionHandler from "@/mocks/handler/missionHandler"; | ||
import roomHandler from "@/mocks/handler/roomHandler"; | ||
|
||
export const worker = setupWorker(...missionHandler); | ||
export const worker = setupWorker(...roomHandler); |
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,34 @@ | ||
import { HttpResponse, http } from "msw"; | ||
import { API_ENDPOINTS } from "@/apis/endpoints"; | ||
import reviewInfo from "@/mocks/mockResponse/reviewInfo.json"; | ||
import roomInfo from "@/mocks/mockResponse/roomInfo.json"; | ||
import roomInfos from "@/mocks/mockResponse/roomInfos.json"; | ||
|
||
const roomHandler = [ | ||
http.get(API_ENDPOINTS.PARTICIPATED_ROOMS, () => { | ||
return HttpResponse.json(roomInfos, { status: 200 }); | ||
}), | ||
http.get(API_ENDPOINTS.OPENED_ROOMS, () => { | ||
return HttpResponse.json(roomInfos, { status: 200 }); | ||
}), | ||
http.get(API_ENDPOINTS.CLOSED_ROOMS, () => { | ||
return HttpResponse.json(roomInfos, { status: 200 }); | ||
}), | ||
http.get(API_ENDPOINTS.ROOMS + "/:id", () => { | ||
return HttpResponse.json(roomInfo, { status: 200 }); | ||
}), | ||
http.post(API_ENDPOINTS.ROOMS + "/:id", () => { | ||
return HttpResponse.json(null, { status: 200 }); | ||
}), | ||
http.get(API_ENDPOINTS.REVIEWERS(1), () => { | ||
return HttpResponse.json(reviewInfo, { status: 200 }); | ||
}), | ||
http.get(API_ENDPOINTS.REVIEWEES(1), () => { | ||
return HttpResponse.json(reviewInfo, { status: 200 }); | ||
}), | ||
http.post(API_ENDPOINTS.REVIEW_COMPLETE, () => { | ||
return HttpResponse.json(null, { status: 200 }); | ||
}), | ||
]; | ||
|
||
export default roomHandler; |
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,22 @@ | ||
{ | ||
"reviewInfo": [ | ||
{ | ||
"userId": 1, | ||
"username": "youngsu5582", | ||
"link": "https://github.com/youngsu5582/java-racing/pull/7", | ||
"isReviewed": true | ||
}, | ||
{ | ||
"userId": 2, | ||
"username": "youngsu5583", | ||
"link": "https://github.com/youngsu5583/java-racing/pull/12", | ||
"isReviewed": false | ||
}, | ||
{ | ||
"userId": 3, | ||
"username": "youngsu5584", | ||
"link": "https://github.com/youngsu5584/java-racing/pull/23", | ||
"isReviewed": false | ||
} | ||
] | ||
} |
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,18 @@ | ||
{ | ||
"roomInfo": { | ||
"id": 1, | ||
"title": "자바 레이싱 카 - TDD", | ||
"content": "TDD를 배우고 싶은 자 나에게로", | ||
"matchingSize": 3, | ||
"repositoryLink": "https://github.com/example/java-racingcar", | ||
"thumbnailLink": "https://gongu.copyright.or.kr/gongu/wrtㅓ/cmmn/wrtFileImageView.do?wrtSn=13301655&filePath=L2Rpc2sxL25ld2RhdGEvMjAyMS8yMS9DTFMxMDAwNC8xMzMwMTY1NV9XUlRfMjFfQ0xTMTAwMDRfMjAyMTEyMTNfMQ==&thumbAt=Y&thumbSe=b_tbumb&wrtTy=10004", | ||
"keywords": ["TDD", "클린코드", "자바"], | ||
"currentParticipantSize": 15, | ||
"maximumParticipantSize": 20, | ||
"manager": "김코딩", | ||
"recruitmentDeadline": "2024-07-30T15:00", | ||
"reviewDeadline": "2024-08-10T23:59", | ||
"isParticipated": true, | ||
"isClosed": false | ||
} | ||
} |
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,36 @@ | ||
{ | ||
"roomInfo": [ | ||
{ | ||
"id": 1, | ||
"title": "자바 레이싱 카 - TDD", | ||
"content": "TDD를 배우고 싶은 자 나에게로", | ||
"matchingSize": 3, | ||
"repositoryLink": "https://github.com/example/java-racingcar", | ||
"thumbnailLink": "https://gongu.copyright.or.kr/gongu/wrtㅓ/cmmn/wrtFileImageView.do?wrtSn=13301655&filePath=L2Rpc2sxL25ld2RhdGEvMjAyMS8yMS9DTFMxMDAwNC8xMzMwMTY1NV9XUlRfMjFfQ0xTMTAwMDRfMjAyMTEyMTNfMQ==&thumbAt=Y&thumbSe=b_tbumb&wrtTy=10004", | ||
"keywords": ["TDD", "클린코드", "자바"], | ||
"currentParticipantSize": 15, | ||
"maximumParticipantSize": 20, | ||
"manager": "김코딩", | ||
"recruitmentDeadline": "2024-07-30T15:00", | ||
"reviewDeadline": "2024-08-10T23:59", | ||
"isParticipated": true, | ||
"isClosed": false | ||
}, | ||
{ | ||
"id": 2, | ||
"title": "자바 레이싱 카 - MVC", | ||
"content": "MVC 패턴을 아시나요?", | ||
"matchingSize": 4, | ||
"repositoryLink": "https://github.com/example/java-racingcar", | ||
"thumbnailLink": "https://gongu.copyright.or.kr/gongu/wrt/cmmn/wrtFileImageView.do?wrtSn=13301655&filePath=L2Rpc2sxL25ld2RhdGEvMjAyMS8yMS9DTFMxMDAwNC8xMzMwMTY1NV9XUlRfMjFfQ0xTMTAwMDRfMjAyMTEyMTNfMQ==&thumbAt=Y&thumbSe=b_tbumb&wrtTy=10004", | ||
"keywords": ["TDD", "클린코드", "자바"], | ||
"currentParticipantSize": 17, | ||
"maximumParticipantSize": 30, | ||
"manager": "최거짓", | ||
"recruitmentDeadline": "2024-07-30T15:00", | ||
"reviewDeadline": "2024-08-10T23:59", | ||
"isParticipated": true, | ||
"isClosed": false | ||
} | ||
] | ||
} |
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 @@ | ||
import { setupServer } from "msw/node"; | ||
import missionHandler from "@/mocks/handler/missionHandler"; | ||
import roomHandler from "@/mocks/handler/roomHandler"; | ||
|
||
export const server = setupServer(...missionHandler); | ||
export const server = setupServer(...roomHandler); |