Skip to content

Commit

Permalink
IEEE-259 Fix dashboard and teamDetails test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Karandeep Lubana committed Jan 30, 2024
1 parent 7db2858 commit 7d20e6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe("Dashboard Page", () => {
expect(get).toHaveBeenNthCalledWith(1, teamUri);
expect(get).toHaveBeenNthCalledWith(2, categoriesUri, {});
expect(get).toHaveBeenNthCalledWith(3, ordersUri);
expect(get).toHaveBeenNthCalledWith(5, hardwareUri, { hardware_ids });
expect(get).toHaveBeenNthCalledWith(4, hardwareUri, { hardware_ids });
});
await waitFor(() => {
const infoButton = within(
Expand All @@ -124,7 +124,7 @@ describe("Dashboard Page", () => {
fireEvent.click(infoButton);
});
await waitFor(() => {
expect(get).toHaveBeenNthCalledWith(6, hardwareDetailUri);
expect(get).toHaveBeenNthCalledWith(5, hardwareDetailUri);
expect(getByText("Product Overview")).toBeVisible();
expect(
getByText(`- Max ${newHardwareData.max_per_team} of this item`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ describe("<TeamDetail />", () => {
1,
`/api/event/teams/${mockTeamMultiple.team_code}/`
);
expect(mockedGet).toHaveBeenNthCalledWith(3, categoriesUri, {});
expect(mockedGet).toHaveBeenNthCalledWith(4, orderAPI, {
expect(mockedGet).toHaveBeenNthCalledWith(2, categoriesUri, {});
expect(mockedGet).toHaveBeenNthCalledWith(3, orderAPI, {
team_code: teamDetailProps.match.params.code,
});
expect(mockedGet).toHaveBeenNthCalledWith(5, "/api/hardware/hardware/", {
expect(mockedGet).toHaveBeenNthCalledWith(4, "/api/hardware/hardware/", {
hardware_ids: [1, 2, 3, 4, 10],
});
});
Expand Down Expand Up @@ -153,11 +153,11 @@ describe("<TeamDetail />", () => {
1,
`/api/event/teams/${mockTeamMultiple.team_code}/`
);
expect(mockedGet).toHaveBeenNthCalledWith(3, categoriesUri, {});
expect(mockedGet).toHaveBeenNthCalledWith(4, orderAPI, {
expect(mockedGet).toHaveBeenNthCalledWith(2, categoriesUri, {});
expect(mockedGet).toHaveBeenNthCalledWith(3, orderAPI, {
team_code: teamDetailProps.match.params.code,
});
expect(mockedGet).toHaveBeenNthCalledWith(5, "/api/hardware/hardware/", {
expect(mockedGet).toHaveBeenNthCalledWith(4, "/api/hardware/hardware/", {
hardware_ids: [1, 2, 3, 4, 10],
});
});
Expand All @@ -180,7 +180,7 @@ describe("<TeamDetail />", () => {
fireEvent.click(infoButton);
});
await waitFor(() => {
expect(mockedGet).toHaveBeenNthCalledWith(6, hardwareDetailUri);
expect(mockedGet).toHaveBeenNthCalledWith(5, hardwareDetailUri);
expect(getByText("Product Overview")).toBeVisible();
expect(
getByText(`- Max ${newHardwareData.max_per_team} of this item`)
Expand Down

0 comments on commit 7d20e6e

Please sign in to comment.