mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-26 18:31:34 +01:00
test(apps): archive completed reconnect fixture
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
28b43785f8
commit
bb7c7719de
1 file changed
+8
-15
@@ -147,29 +147,22 @@ test.describe.serial("not-connected app page", () => {
|
||||
expect(appConns[0].status).not.toBe("archived");
|
||||
});
|
||||
|
||||
test("draft app connection stays on provider setup until setup finishes", async ({ page, request }) => {
|
||||
const draft = await request.post(`/api/companies/${seed.companyId}/tools/apps/connect`, {
|
||||
data: {
|
||||
link: `${mock.url}?draft=1`,
|
||||
name: "Draft app",
|
||||
credentialValues: { "credentials.authorization": "qa-token" },
|
||||
},
|
||||
});
|
||||
expect(draft.ok(), `draft connect failed ${draft.status()}: ${await draft.text()}`).toBe(true);
|
||||
const draftBody = await draft.json();
|
||||
await request.delete(`/api/tool-connections/${draftBody.connectionId}`);
|
||||
await request.patch(`/api/tool-applications/${draftBody.application.id}`, { data: { status: "active" } });
|
||||
test("archived app connection returns to provider setup", async ({ page, request }) => {
|
||||
const archive = await request.delete(`/api/tool-connections/${connectionId}`);
|
||||
expect(archive.ok(), `archive failed ${archive.status()}: ${await archive.text()}`).toBe(true);
|
||||
const revive = await request.patch(`/api/tool-applications/${applicationId}`, { data: { status: "active" } });
|
||||
expect(revive.ok(), `revive failed ${revive.status()}: ${await revive.text()}`).toBe(true);
|
||||
|
||||
await page.goto(`/${seed.prefix}/apps/app/${draftBody.application.id}`);
|
||||
await page.goto(`/${seed.prefix}/apps/app/${applicationId}`);
|
||||
await expect(page).toHaveURL(
|
||||
new RegExp(`/${seed.prefix}/apps/app/${draftBody.application.id}/setup$`),
|
||||
new RegExp(`/${seed.prefix}/apps/app/${applicationId}/setup$`),
|
||||
{ timeout: 20_000 },
|
||||
);
|
||||
await expect(page.getByText("Not connected", { exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("heading", { name: "Connect this app" })).toBeVisible();
|
||||
|
||||
await page.goto(`/${seed.prefix}/apps/connections`);
|
||||
const row = page.locator("tbody tr", { hasText: "Draft app" });
|
||||
const row = page.locator("tbody tr", { hasText: "Bla" });
|
||||
await expect(row).toBeVisible({ timeout: 30_000 });
|
||||
await expect(row.getByRole("button", { name: "Connect" })).toBeVisible();
|
||||
await page.screenshot({ path: `${SCREENSHOT_DIR}/apps-nav-w6-03-reconnected-row.png`, fullPage: true });
|
||||
|
||||
Reference in new issue
Block a user