Skip to content

Commit

Permalink
test: update jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
Psami-wondah committed Oct 1, 2024
1 parent 55952a8 commit 9ee1a5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ test("clicking duplicate button should duplicate chart", async () => {
const mockedAxios = axios.get as jest.Mock;
mockedAxios
.mockResolvedValueOnce({
data: { id: "chart-id" },
data: { data: { id: "chart-id" } },
} as AxiosResponse<any>)
.mockResolvedValueOnce({ data: mockChartList });
jest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,10 @@ describe("Tests for tablet and desktop view", () => {
const axiosMock = axios.get as jest.Mock;

axiosMock
.mockResolvedValueOnce({ data: { id: "12345" } } as AxiosResponse<any>)
.mockResolvedValueOnce({ data: [] });
.mockResolvedValueOnce({
data: { data: { id: "12345" } },
} as AxiosResponse<any>)
.mockResolvedValueOnce({ data: { data: [] } });
jest
.spyOn(Router, "useParams")
.mockReturnValue({ page: "12345", view: undefined });
Expand Down

0 comments on commit 9ee1a5f

Please sign in to comment.