Skip to content

Commit

Permalink
test: (#740) 단건 신고 처리 조회 msw 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
chsua committed Oct 15, 2023
1 parent 4a4ba91 commit c1f94d4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { mockPost } from './post';
import { mockPostList } from './postList';
import { mockRanking } from './ranking';
import { mockReport } from './report';
import { mockReportConfirmResult } from './reportConfirmResult';
import { mockToken } from './token';
import { mockUserInfo } from './userInfo';
import { mockVote } from './vote';
Expand All @@ -24,4 +25,5 @@ export const handlers = [
...mockRanking,
...mockToken,
...mockAlarm,
...mockReportConfirmResult,
];
9 changes: 9 additions & 0 deletions frontend/src/mocks/mockData/reportConfirmResult.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ReportConfirmResult } from '@api/alarm';

export const MOCK_REPORT_CONFIRM_RESULT: ReportConfirmResult = {
id: 1,
type: 'POST',
reason: ['BEHAVIOR', 'SPECIFIC_PERSON', 'PRIVACY', 'SPAMMING', 'BEHAVIOR'],
content: '10004',
createAt: '2023-12-21 09:11',
};
9 changes: 9 additions & 0 deletions frontend/src/mocks/reportConfirmResult.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { rest } from 'msw';

import { MOCK_REPORT_CONFIRM_RESULT } from './mockData/reportConfirmResult';

export const mockReportConfirmResult = [
rest.get('/alarms/report/:reportId', (req, res, ctx) => {
return res(ctx.status(200), ctx.delay(500), ctx.json(MOCK_REPORT_CONFIRM_RESULT));
}),
];

0 comments on commit c1f94d4

Please sign in to comment.