-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop/fe' into fix/fe/#180
- Loading branch information
Showing
65 changed files
with
1,616 additions
and
234 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
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,45 @@ | ||
import { waitFor } from "@testing-library/react"; | ||
|
||
import { createInfiniteTravelogueHook } from "./utils/createInfiniteTravelogueHook"; | ||
|
||
describe("메인 페이지", () => { | ||
describe("여행기 무한 스크롤 확인", () => { | ||
it("메인 페이지로 진입했을때 보여지는 여행기는 총 5개이다.", async () => { | ||
const { result } = createInfiniteTravelogueHook(); | ||
await waitFor(() => { | ||
expect(result.current.status).toMatch("success"); | ||
expect(result.current.travelogues.length).toBe(5); | ||
}); | ||
}); | ||
|
||
it("다음 페이지로 이동할 경우 보여지는 여행기는 총 10개이다.", async () => { | ||
const { result } = createInfiniteTravelogueHook(); | ||
|
||
await waitFor(() => { | ||
result.current.fetchNextPage(); | ||
}); | ||
|
||
await waitFor(() => { | ||
expect(result.current.status).toMatch("success"); | ||
expect(result.current.travelogues.length).toBe(10); | ||
}); | ||
}); | ||
|
||
it("마지막 페이지로 이동할 경우 더 이상 콘텐츠를 확인할 수 없다.", async () => { | ||
const { result } = createInfiniteTravelogueHook(); | ||
|
||
await waitFor(() => { | ||
result.current.fetchNextPage(); | ||
}); | ||
|
||
await waitFor(() => { | ||
result.current.fetchNextPage(); | ||
}); | ||
|
||
await waitFor(() => { | ||
expect(result.current.status).toMatch("success"); | ||
expect(result.current.hasNextPage).toBeFalsy(); | ||
}); | ||
}); | ||
}); | ||
}); |
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 @@ | ||
import { renderHook } from "@testing-library/react"; | ||
|
||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
|
||
import useInfiniteTravelogues from "@queries/useInfiniteTravelogues"; | ||
|
||
const queryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
retry: 0, | ||
}, | ||
}, | ||
}); | ||
|
||
export const wrapper = ({ children }: React.PropsWithChildren) => ( | ||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider> | ||
); | ||
|
||
export const createInfiniteTravelogueHook = () => | ||
renderHook(() => useInfiniteTravelogues(), { | ||
wrapper, | ||
}); |
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
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
4 changes: 3 additions & 1 deletion
4
frontend/src/components/common/Accordion/AccordionItem/accordionItemContext.ts
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
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
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
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
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
Oops, something went wrong.