mirror of
https://seed.radicle.dev/rad:z4D5UCArafTzTQpDZNQRuqswh3ury.git
synced 2026-10-18 19:10:45 +08:00
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.
40 lines
1005 B
TypeScript
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();
|
|
});
|