diff --git a/spinifex/services/spinifexui/frontend/oxlint.config.ts b/spinifex/services/spinifexui/frontend/oxlint.config.ts index ac8341bee..ff64712f6 100644 --- a/spinifex/services/spinifexui/frontend/oxlint.config.ts +++ b/spinifex/services/spinifexui/frontend/oxlint.config.ts @@ -113,10 +113,8 @@ export default defineConfig({ "typescript/no-unsafe-type-assertion": "off", "unicorn/no-useless-undefined": "off", "vitest/max-expects": "off", - "vitest/prefer-called-once": "off", "vitest/prefer-called-with": "off", "vitest/prefer-describe-function-title": "off", - "vitest/prefer-expect-resolves": "off", "vitest/prefer-import-in-mock": "off", "vitest/require-mock-type-parameters": "off", }, diff --git a/spinifex/services/spinifexui/frontend/src/components/system-image-required.test.tsx b/spinifex/services/spinifexui/frontend/src/components/system-image-required.test.tsx index 90fd02c44..bd378335e 100644 --- a/spinifex/services/spinifexui/frontend/src/components/system-image-required.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/components/system-image-required.test.tsx @@ -40,7 +40,7 @@ describe("SystemImageRequired", () => { await user.click(screen.getByRole("button", { name: "Copy command" })) - expect(await navigator.clipboard.readText()).toBe(importCommand) + await expect(navigator.clipboard.readText()).resolves.toBe(importCommand) }) it("calls onRecheck when Recheck is clicked", async () => { diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ec2/(key)/-components/create-key-pair-page.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ec2/(key)/-components/create-key-pair-page.test.tsx index 1920e1265..5117da5a2 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ec2/(key)/-components/create-key-pair-page.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ec2/(key)/-components/create-key-pair-page.test.tsx @@ -51,7 +51,7 @@ describe("create-key-pair route", () => { await user.type(screen.getByLabelText("Key Pair Name"), "my-key") await user.click(screen.getByRole("button", { name: "Create Key Pair" })) - await waitFor(() => expect(send).toHaveBeenCalledTimes(1)) + await waitFor(() => expect(send).toHaveBeenCalledOnce()) expect(send.mock.calls[0]?.[0].input).toStrictEqual({ KeyName: "my-key", KeyType: "rsa", @@ -67,7 +67,7 @@ describe("create-key-pair route", () => { await user.click(screen.getByRole("option", { name: "ED25519" })) await user.click(screen.getByRole("button", { name: "Create Key Pair" })) - await waitFor(() => expect(send).toHaveBeenCalledTimes(1)) + await waitFor(() => expect(send).toHaveBeenCalledOnce()) expect(send.mock.calls[0]?.[0].input).toStrictEqual({ KeyName: "my-key", KeyType: "ed25519", diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecr/(repositories)/-components/create-repository-dialog.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecr/(repositories)/-components/create-repository-dialog.test.tsx index e6f179378..3caef198f 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecr/(repositories)/-components/create-repository-dialog.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecr/(repositories)/-components/create-repository-dialog.test.tsx @@ -34,7 +34,7 @@ describe("CreateRepositoryDialog", () => { expect(createButton).toBeEnabled() fireEvent.click(createButton) - await waitFor(() => expect(send).toHaveBeenCalledTimes(1)) + await waitFor(() => expect(send).toHaveBeenCalledOnce()) expect(send.mock.calls[0]![0].input).toStrictEqual({ repositoryName: "team/app", }) @@ -51,8 +51,8 @@ describe("CreateRepositoryDialog", () => { target: { value: "dupe" }, }) fireEvent.click(screen.getByRole("button", { name: "Create Repository" })) - expect( - await screen.findByText("RepositoryAlreadyExists"), - ).toBeInTheDocument() + await expect( + screen.findByText("RepositoryAlreadyExists"), + ).resolves.toBeInTheDocument() }) }) diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecr/(repositories)/-components/push-commands.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecr/(repositories)/-components/push-commands.test.tsx index 43e2bd5eb..fda8fca2d 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecr/(repositories)/-components/push-commands.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecr/(repositories)/-components/push-commands.test.tsx @@ -23,8 +23,8 @@ describe("PushCommands", () => { }) render() fireEvent.click(screen.getByRole("button", { name: "Copy" })) - await waitFor(() => expect(writeText).toHaveBeenCalledTimes(1)) + await waitFor(() => expect(writeText).toHaveBeenCalledOnce()) expect(writeText.mock.calls[0]![0]).toContain(`docker push ${URI}:latest`) - expect(await screen.findByText("Copied")).toBeInTheDocument() + await expect(screen.findByText("Copied")).resolves.toBeInTheDocument() }) }) diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/create-cluster-dialog.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/create-cluster-dialog.test.tsx index e4cb87301..2ae23388e 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/create-cluster-dialog.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/create-cluster-dialog.test.tsx @@ -32,7 +32,7 @@ describe("CreateClusterDialog", () => { expect(createButton).toBeEnabled() fireEvent.click(createButton) - await waitFor(() => expect(send).toHaveBeenCalledTimes(1)) + await waitFor(() => expect(send).toHaveBeenCalledOnce()) expect(send.mock.calls[0]![0].input).toStrictEqual({ clusterName: "web" }) await waitFor(() => expect(onOpenChange).toHaveBeenCalledWith(false)) }) @@ -47,6 +47,8 @@ describe("CreateClusterDialog", () => { target: { value: "dupe" }, }) fireEvent.click(screen.getByRole("button", { name: "Create Cluster" })) - expect(await screen.findByText("ClusterAlreadyExists")).toBeInTheDocument() + await expect( + screen.findByText("ClusterAlreadyExists"), + ).resolves.toBeInTheDocument() }) }) diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/iam/-components/attached-policies-panel.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/iam/-components/attached-policies-panel.test.tsx index c14319587..141dc7476 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/iam/-components/attached-policies-panel.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/iam/-components/attached-policies-panel.test.tsx @@ -135,9 +135,9 @@ describe("AttachedPoliciesPanel", () => { fireEvent.click(screen.getByRole("button", { name: "Attach Policy" })) fireEvent.click(screen.getByRole("button", { name: /AvailablePolicy/ })) - expect( - await screen.findByText("Failed to attach policy"), - ).toBeInTheDocument() + await expect( + screen.findByText("Failed to attach policy"), + ).resolves.toBeInTheDocument() expect(screen.getByText("Select a policy to attach:")).toBeInTheDocument() expect( screen.getByRole("button", { name: /AvailablePolicy/ }), @@ -152,9 +152,9 @@ describe("AttachedPoliciesPanel", () => { ) fireEvent.click(screen.getByRole("button", { name: "Detach" })) - expect( - await screen.findByText("Failed to detach policy"), - ).toBeInTheDocument() + await expect( + screen.findByText("Failed to detach policy"), + ).resolves.toBeInTheDocument() await waitFor(() => expect(screen.getByRole("button", { name: "Detach" })).toBeEnabled(), ) diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/iam/-components/inline-policies-panel.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/iam/-components/inline-policies-panel.test.tsx index f6d1f3699..6f5a8594e 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/iam/-components/inline-policies-panel.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/iam/-components/inline-policies-panel.test.tsx @@ -132,9 +132,9 @@ describe("InlinePoliciesPanel", () => { ) fireEvent.click(screen.getByRole("button", { name: "Edit" })) - expect( - await screen.findByText("Failed to load inline policy"), - ).toBeInTheDocument() + await expect( + screen.findByText("Failed to load inline policy"), + ).resolves.toBeInTheDocument() }) it("edits an inline policy and saves via PutUserPolicy", async () => { diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(parameter-groups)/-components/create-db-parameter-group-page.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(parameter-groups)/-components/create-db-parameter-group-page.test.tsx index 204d1f869..ac7c42c39 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(parameter-groups)/-components/create-db-parameter-group-page.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(parameter-groups)/-components/create-db-parameter-group-page.test.tsx @@ -101,9 +101,9 @@ describe("CreateDBParameterGroupPage", () => { screen.getByRole("button", { name: "Create Parameter Group" }), ) - expect( - await screen.findByText(/may not begin with "default\."/), - ).toBeInTheDocument() + await expect( + screen.findByText(/may not begin with "default\."/), + ).resolves.toBeInTheDocument() expect(mockSend).not.toHaveBeenCalled() }) @@ -117,9 +117,9 @@ describe("CreateDBParameterGroupPage", () => { screen.getByRole("button", { name: "Create Parameter Group" }), ) - expect( - await screen.findByText("Description is required"), - ).toBeInTheDocument() + await expect( + screen.findByText("Description is required"), + ).resolves.toBeInTheDocument() expect(mockSend).not.toHaveBeenCalled() }) }) diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(parameter-groups)/-components/parameters-editor.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(parameter-groups)/-components/parameters-editor.test.tsx index 852724add..eed76823e 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(parameter-groups)/-components/parameters-editor.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(parameter-groups)/-components/parameters-editor.test.tsx @@ -202,9 +202,9 @@ describe("ParametersEditor", () => { }) fireEvent.click(screen.getByRole("button", { name: "Save Changes" })) - expect( - await screen.findByText(/parameter max_connections is static/), - ).toBeInTheDocument() + await expect( + screen.findByText(/parameter max_connections is static/), + ).resolves.toBeInTheDocument() }) it("offers no control at all on a read-only group", () => { diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/create-db-snapshot-dialog.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/create-db-snapshot-dialog.test.tsx index 52c724914..a111641e3 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/create-db-snapshot-dialog.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/create-db-snapshot-dialog.test.tsx @@ -80,7 +80,9 @@ describe("CreateDBSnapshotDialog opened from an instance", () => { await user.clear(field) await user.type(field, "rds:orders-db") submit() - expect(await screen.findByText(/may not begin with/)).toBeInTheDocument() + await expect( + screen.findByText(/may not begin with/), + ).resolves.toBeInTheDocument() expect(mockSend).not.toHaveBeenCalled() }) @@ -90,7 +92,9 @@ describe("CreateDBSnapshotDialog opened from an instance", () => { ) render("orders-db") submit() - expect(await screen.findByText(/is not available/)).toBeInTheDocument() + await expect( + screen.findByText(/is not available/), + ).resolves.toBeInTheDocument() }) }) diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/delete-db-snapshot-dialog.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/delete-db-snapshot-dialog.test.tsx index 12c39f658..f6d44d732 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/delete-db-snapshot-dialog.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/delete-db-snapshot-dialog.test.tsx @@ -60,9 +60,9 @@ describe("DeleteDBSnapshotDialog", () => { const onDeleted = vi.fn() render(onDeleted) fireEvent.click(screen.getByRole("button", { name: "Delete" })) - expect( - await screen.findByText(/is in use by orders-db-restored/), - ).toBeInTheDocument() + await expect( + screen.findByText(/is in use by orders-db-restored/), + ).resolves.toBeInTheDocument() expect(onDeleted).not.toHaveBeenCalled() }) }) diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/restore-db-snapshot-page.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/restore-db-snapshot-page.test.tsx index 1fdda3f29..1b7db9429 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/restore-db-snapshot-page.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(snapshots)/-components/restore-db-snapshot-page.test.tsx @@ -305,7 +305,9 @@ describe("RestoreDBSnapshotPage form", () => { await selectInstanceClass(user) fireEvent.click(screen.getByRole("button", { name: "Restore Snapshot" })) - expect(await screen.findByText(/already exists/)).toBeInTheDocument() + await expect( + screen.findByText(/already exists/), + ).resolves.toBeInTheDocument() }) it("builds a CLI command for the restore", () => { diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(subnet-groups)/-components/create-db-subnet-group-page.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(subnet-groups)/-components/create-db-subnet-group-page.test.tsx index ea65ce060..07804af2c 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(subnet-groups)/-components/create-db-subnet-group-page.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(subnet-groups)/-components/create-db-subnet-group-page.test.tsx @@ -134,7 +134,9 @@ describe("CreateDBSubnetGroupPage", () => { fireEvent.click(subnetCheckbox("subnet-a1")) fireEvent.click(screen.getByRole("button", { name: "Create Subnet Group" })) - expect(await screen.findByText(/the service reserves/)).toBeInTheDocument() + await expect( + screen.findByText(/the service reserves/), + ).resolves.toBeInTheDocument() expect(mockSend).not.toHaveBeenCalled() }) }) diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(subnet-groups)/-components/delete-db-subnet-group-dialog.test.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(subnet-groups)/-components/delete-db-subnet-group-dialog.test.tsx index ab8106bed..3633e06dd 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(subnet-groups)/-components/delete-db-subnet-group-dialog.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/rds/(subnet-groups)/-components/delete-db-subnet-group-dialog.test.tsx @@ -51,8 +51,8 @@ describe("DeleteDBSubnetGroupDialog", () => { ) render() fireEvent.click(screen.getByRole("button", { name: "Delete" })) - expect( - await screen.findByText(/is still used by orders-db/), - ).toBeInTheDocument() + await expect( + screen.findByText(/is still used by orders-db/), + ).resolves.toBeInTheDocument() }) }) diff --git a/spinifex/services/spinifexui/frontend/src/test/rds-e2e.test.tsx b/spinifex/services/spinifexui/frontend/src/test/rds-e2e.test.tsx index c0dbde064..cb36ac327 100644 --- a/spinifex/services/spinifexui/frontend/src/test/rds-e2e.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/test/rds-e2e.test.tsx @@ -538,8 +538,8 @@ describe("RDS cross-slice flow (mocked SDK)", () => { expect(listed.DBInstances?.[0]?.Endpoint?.Port).toBe(5432) // The poll the conditional refetchInterval drives, run by hand. - expect(await statusOf(qc)).toBe("creating") - expect(await statusOf(qc)).toBe("available") + await expect(statusOf(qc)).resolves.toBe("creating") + await expect(statusOf(qc)).resolves.toBe("available") await result.current.modify.mutateAsync({ dbInstanceIdentifier: "orders-db",