test: align private cache e2e
This commit is contained in:
1 parent
2449eb0bc7
commit
c34629d39e
1 file changed
+6
-4
@@ -17,7 +17,7 @@ const adminCredentials = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
describe("lazy widget application graph", () => {
|
describe("lazy widget application graph", () => {
|
||||||
test("renders an authenticated board and preserves first-use UI behavior after reload", async () => {
|
test("renders an authenticated board and refetches private widget data after reload", async () => {
|
||||||
const { db, localMountPath } = await createSqliteDbFileAsync();
|
const { db, localMountPath } = await createSqliteDbFileAsync();
|
||||||
const { userId } = await seedAdminUserAsync(db, adminCredentials);
|
const { userId } = await seedAdminUserAsync(db, adminCredentials);
|
||||||
const boardId = createId();
|
const boardId = createId();
|
||||||
@@ -162,8 +162,9 @@ describe("lazy widget application graph", () => {
|
|||||||
timeout: 30_000,
|
timeout: 30_000,
|
||||||
});
|
});
|
||||||
await expect.poll(() => refreshRequestStarted, { timeout: 10_000 }).toBe(true);
|
await expect.poll(() => refreshRequestStarted, { timeout: 10_000 }).toBe(true);
|
||||||
await expect(cachedDownload).toBeVisible({ timeout: 5_000 });
|
await expect(cachedDownload).toHaveCount(0);
|
||||||
await expect(downloadsWidget.locator("[data-widget-refreshing]")).toBeVisible();
|
await expect(downloadsWidget.getByRole("status")).toContainText("Loading widget data");
|
||||||
|
await expect(downloadsWidget.locator("[data-widget-refreshing]")).toHaveCount(0);
|
||||||
|
|
||||||
const refreshedDownloadsResponse = page.waitForResponse(
|
const refreshedDownloadsResponse = page.waitForResponse(
|
||||||
(response) => response.url().includes("widget.downloads.getJobsAndStatuses") && response.ok(),
|
(response) => response.url().includes("widget.downloads.getJobsAndStatuses") && response.ok(),
|
||||||
@@ -171,7 +172,8 @@ describe("lazy widget application graph", () => {
|
|||||||
releaseRefresh();
|
releaseRefresh();
|
||||||
releaseRefresh = undefined;
|
releaseRefresh = undefined;
|
||||||
await refreshedDownloadsResponse;
|
await refreshedDownloadsResponse;
|
||||||
await expect(downloadsWidget.locator("[data-widget-refreshing]")).toHaveCount(0);
|
await expect(cachedDownload).toBeVisible({ timeout: 30_000 });
|
||||||
|
await expect(downloadsWidget.getByRole("status")).toHaveCount(0);
|
||||||
await page.unroute(downloadsRequestPattern, delayDownloadsRefresh);
|
await page.unroute(downloadsRequestPattern, delayDownloadsRefresh);
|
||||||
expect(pageErrors).toEqual([]);
|
expect(pageErrors).toEqual([]);
|
||||||
expect(hydrationErrors).toEqual([]);
|
expect(hydrationErrors).toEqual([]);
|
||||||
|
|||||||
Reference in new issue
Block a user