Skip to content

Commit

Permalink
use renderWithProviders in SSHKeyList test
Browse files Browse the repository at this point in the history
  • Loading branch information
ndv99 committed Feb 21, 2025
1 parent 55ce9d5 commit 93edbe8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/app/base/components/SSHKeyList/SSHKeyList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import * as factory from "@/testing/factories";
import { sshKeyResolvers } from "@/testing/resolvers/sshKeys";
import {
mockIsPending,
renderWithBrowserRouter,
renderWithProviders,
screen,
setupMockServer,
userEvent,
waitFor,
waitForLoading,
within,
} from "@/testing/utils";
Expand Down Expand Up @@ -111,10 +109,10 @@ describe("SSHKeyList", () => {
});
const keyValue = mockKeys.items[2].key;

await waitFor(() => {
// verifies that the full value is exposed in the title attribute
expect(screen.getByText(keyValue)).toHaveAccessibleName(keyValue);
});
await waitForLoading();

// verifies that the full value is exposed in the title attribute
expect(screen.getByText(keyValue)).toHaveAccessibleName(keyValue);
});

it("can display uploaded keys", async () => {
Expand Down Expand Up @@ -169,7 +167,7 @@ describe("SSHKeyList", () => {
sshKeyResolvers.listSshKeys.handler({ items: [], total: 0 })
);

renderWithBrowserRouter(<SSHKeyList />, {
renderWithProviders(<SSHKeyList />, {
route: "/account/prefs/ssh-keys",
});

Expand Down

0 comments on commit 93edbe8

Please sign in to comment.