Something went wrong. Try again.
A downstream fork of Tranquil PDS for use in margin.cafe
Something went wrong. Try again.
1234567891011121314151617181920212223242526import { fireEvent, render, screen } from "@testing-library/svelte";import { describe, expect, it, vi } from "vitest";import AppPasswordStep from "../components/migration/AppPasswordStep.svelte";
describe("AppPasswordStep", () => { it("hides the generated app password until the user reveals it", async () => { const appPassword = "abcd-efgh-ijkl-mnop";
render(AppPasswordStep, { props: { appPassword, appPasswordName: "Generated during registration", loading: false, onContinue: vi.fn(), }, });
expect(screen.queryByText(appPassword)).not.toBeInTheDocument();
await fireEvent.click(screen.getByRole("button", { name: "Show" })); expect(screen.getByText(appPassword)).toBeInTheDocument();
await fireEvent.click(screen.getByRole("button", { name: "Hide" })); expect(screen.queryByText(appPassword)).not.toBeInTheDocument(); });});