|
| 1 | +import { test, expect } from "@playwright/test"; |
| 2 | + |
| 3 | +test("maxChunks and cleanup", async ({ page }) => { |
| 4 | + await page.goto("http://localhost:3000/#size=32"); |
| 5 | + await page.getByLabel("Max total chunks:").dblclick(); |
| 6 | + await page.getByLabel("Max total chunks:").fill("100"); |
| 7 | + await page.getByLabel("Size of item (KB): *").dblclick(); |
| 8 | + await page.getByLabel("Size of item (KB): *").press("ControlOrMeta+a"); |
| 9 | + await page.getByLabel("Size of item (KB): *").fill("5"); |
| 10 | + await page.goto("http://localhost:3000/#size=5"); |
| 11 | + await page.getByLabel("Size of item (KB): *").fill("50"); |
| 12 | + await page.goto("http://localhost:3000/#size=50"); |
| 13 | + await page.getByLabel("Size of item (KB): *").fill("500"); |
| 14 | + await page.goto("http://localhost:3000/#size=500"); |
| 15 | + await page.getByLabel("Size of item (KB): *").press("ControlOrMeta+a"); |
| 16 | + await page.getByLabel("Size of item (KB): *").press("ArrowLeft"); |
| 17 | + await page.getByLabel("Size of item (KB): *").press("Shift+ArrowRight"); |
| 18 | + await page.getByLabel("Size of item (KB): *").fill("800"); |
| 19 | + await page.goto("http://localhost:3000/#size=800"); |
| 20 | + await page.getByLabel("Size of item (KB): *").press("ControlOrMeta+a"); |
| 21 | + await page.getByLabel("Size of item (KB): *").fill("1"); |
| 22 | + await page.goto("http://localhost:3000/#size=1"); |
| 23 | + await page.getByLabel("Size of item (KB): *").fill("12"); |
| 24 | + await page.goto("http://localhost:3000/#size=12"); |
| 25 | + await page.getByLabel("Size of item (KB): *").fill("120"); |
| 26 | + await page.goto("http://localhost:3000/#size=120"); |
| 27 | + await page.getByLabel("Size of item (KB): *").fill("1200"); |
| 28 | + await page.goto("http://localhost:3000/#size=1200"); |
| 29 | + await page.getByLabel("Size of item (KB): *").press("ArrowLeft"); |
| 30 | + await page.getByLabel("Size of item (KB): *").press("ArrowLeft"); |
| 31 | + await page.getByLabel("Size of item (KB): *").press("Shift+ArrowLeft"); |
| 32 | + await page.getByLabel("Size of item (KB): *").fill("1300"); |
| 33 | + await page.goto("http://localhost:3000/#size=1300"); |
| 34 | + await page.getByTestId("set-item-button").click(); |
| 35 | + // ensures enough time for IDB to take effect |
| 36 | + await page.getByTestId("count-button").click(); |
| 37 | + await page.getByTestId("count-button").click(); |
| 38 | + await page.getByTestId("count-button").click(); |
| 39 | + await expect(page.getByText("54")).toBeVisible(); |
| 40 | + await page.getByTestId("set-item-button").click(); |
| 41 | + // ensures enough time for IDB to take effect |
| 42 | + await page.getByTestId("count-button").click(); |
| 43 | + await page.getByTestId("count-button").click(); |
| 44 | + await page.getByTestId("count-button").click(); |
| 45 | + await expect(page.getByText("108")).toBeVisible(); |
| 46 | + await page.getByTestId("cleanup-button").click(); |
| 47 | + // ensures enough time for IDB to take effect |
| 48 | + await page.getByTestId("count-button").click(); |
| 49 | + await page.getByTestId("count-button").click(); |
| 50 | + await page.getByTestId("count-button").click(); |
| 51 | + await expect(page.getByText("100")).toBeVisible(); |
| 52 | +}); |
0 commit comments