Files
radicle-desktop/tests/e2e/auth.spec.ts
T
Rūdolfs Ošiņš 086afbb5dc Give each e2e test its own reliable peer
The page always talked to the shared palm backend, so tests couldn't set
up peers of their own. Peers now have no passphrase by default, so tests
don't need an ssh-agent and test keys stay out of the developer's agent.
Fixtures wait for replication instead of relying on gossip timing, and a
request cancelled by a reload no longer counts as a page error.
2026-10-01 18:16:29 +02:00

40 lines
1005 B
TypeScript

import {
expect,
gitOptions,
test,
useBackend,
} from "@tests/support/fixtures.js";
test("unlocks encrypted keys through the ssh-agent", async ({
page,
peerManager,
sshAuthSock,
}) => {
const peer = await peerManager.createPeer({
name: "locked",
gitOptions: gitOptions["bob"],
passphrase: "asdf",
sshAuthSock,
});
await peer.logOut();
await peer.startHttpd();
await useBackend(page, peer);
await page.goto("/");
await expect(page.getByText("Unlock keys")).toBeVisible();
await page
.getByPlaceholder("Enter passphrase to unlock your keys")
.fill("wrong");
await page.getByRole("button", { name: "Unlock" }).click();
await expect(
page.getByText("Not able to decrypt keys with provided passphrase."),
).toBeVisible();
await page
.getByPlaceholder("Enter passphrase to unlock your keys")
.fill("asdf");
await page.getByRole("button", { name: "Unlock" }).click();
await expect(page.getByText("Unlock keys")).toBeHidden();
});