[web] Previews and the team: a Previews screen (see: 1 click, close: 2), sign-in from a setup or invite link, Settings → Team (invite: 3 clicks), previews-only API tokens; click-counted tests
This commit is contained in:
@@ -170,6 +170,37 @@ describe("ROADMAP §4 flows, clicks counted", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("T4 flows, clicks counted", () => {
|
||||
it("See active previews = 1 click", async () => {
|
||||
start();
|
||||
const nav = (await screen.findAllByRole("navigation", { name: "Main" }, T))[0];
|
||||
await click(within(nav).getByRole("link", { name: "Previews" }));
|
||||
await screen.findByRole("link", { name: "fix-42--shop.preview.home.test" }, T);
|
||||
expect(clicks).toBe(1);
|
||||
});
|
||||
|
||||
it("Kill a preview = 2 clicks (Close → Close preview)", async () => {
|
||||
start("/previews");
|
||||
await click(await screen.findByRole("button", { name: "Close" }, T));
|
||||
await click(await screen.findByRole("button", { name: "Close preview" }));
|
||||
await waitFor(() => expect(called("DELETE", "/previews/fix-42--shop.preview.home.test")).toBe(true), T);
|
||||
await screen.findByRole("heading", { name: "No previews open" }, T);
|
||||
expect(clicks).toBe(2);
|
||||
});
|
||||
|
||||
it("Invite a teammate: Settings → Team → Invite = 3 clicks, the link shown", async () => {
|
||||
start();
|
||||
const nav = (await screen.findAllByRole("navigation", { name: "Main" }, T))[0];
|
||||
await click(within(nav).getByRole("link", { name: "Settings" }));
|
||||
await click(await screen.findByRole("tab", { name: "Team" }));
|
||||
await user.type(await screen.findByLabelText("Name"), "Petra");
|
||||
await click(screen.getByRole("button", { name: "Invite" }));
|
||||
const link = (await screen.findByLabelText("Invite link", {}, T)) as HTMLInputElement;
|
||||
expect(link.value).toMatch(/\/#signin=iin_testcode$/);
|
||||
expect(clicks).toBe(3);
|
||||
});
|
||||
});
|
||||
|
||||
describe("focus", () => {
|
||||
it("+ Host puts the cursor in Hostname, so typing right after the click lands there", async () => {
|
||||
start();
|
||||
|
||||
Reference in New Issue
Block a user