mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-01 15:35:12 +01:00
test: prevent announcements from obscuring quota screenshots
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
d4de579f4b
commit
dede51d286
1 file changed
+5
-4
@@ -33,16 +33,17 @@ test("provider quotas keep accounts separate, preserve unknown usage, and retain
|
||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||
await page.clock.install();
|
||||
await page.goto(`/${company.issuePrefix}/activity/costs`);
|
||||
const dismissAnnouncement = page.getByRole("button", { name: "Dismiss announcement" });
|
||||
if (await dismissAnnouncement.isVisible()) await dismissAnnouncement.click();
|
||||
await page.getByRole("tab", { name: "Providers", exact: true }).click();
|
||||
const personal = page.locator("section").filter({ has: page.getByText("Personal subscription", { exact: true }) });
|
||||
const team = page.locator("section").filter({ has: page.getByText("Team subscription", { exact: true }) });
|
||||
const providerCard = page.locator('[data-slot="card"]').filter({ has: personal });
|
||||
// Announcement timing is unrelated to quota behavior; keep its floating
|
||||
// card from covering the evidence when the provider card scrolls into view.
|
||||
const screenshotOptions = { style: '[aria-label="Paperclip announcements"] { visibility: hidden; }' };
|
||||
await expect(personal.getByRole("progressbar", { name: "5h: 42%" })).toBeVisible();
|
||||
await expect(team.getByText("Usage not reported", { exact: true })).toBeVisible();
|
||||
await expect(team.getByRole("progressbar")).toHaveCount(0);
|
||||
await info.attach("provider-quota-multiple-accounts-and-unknown-usage", { body: await providerCard.screenshot(), contentType: "image/png" });
|
||||
await info.attach("provider-quota-multiple-accounts-and-unknown-usage", { body: await providerCard.screenshot(screenshotOptions), contentType: "image/png" });
|
||||
|
||||
refreshFails = true;
|
||||
const refresh = page.waitForResponse(response => response.url().endsWith("/costs/quota-windows"));
|
||||
@@ -52,7 +53,7 @@ test("provider quotas keep accounts separate, preserve unknown usage, and retain
|
||||
await expect(team.getByText("Usage not reported", { exact: true })).toBeVisible();
|
||||
await expect(personal.getByText("Showing the last available quota. Updates will resume automatically.", { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("raw provider command failed", { exact: false })).toHaveCount(0);
|
||||
await info.attach("provider-quota-refresh-failure-retains-readings", { body: await providerCard.screenshot(), contentType: "image/png" });
|
||||
await info.attach("provider-quota-refresh-failure-retains-readings", { body: await providerCard.screenshot(screenshotOptions), contentType: "image/png" });
|
||||
} finally {
|
||||
await request.delete(api);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user