|
| 1 | +import { test, expect } from "@playwright/test"; |
| 2 | + |
| 3 | +test("bail on setItem when item itself exceeds maxChunks", async ({ page }) => { |
| 4 | + await page.goto("http://localhost:3000/#size=32"); |
| 5 | + await page.getByTestId("reset-cacheKey").click(); |
| 6 | + await page.getByTestId("clear-button").click(); |
| 7 | + await page.getByTestId("count-button").click(); |
| 8 | + await expect(page.getByTestId("count-value")).toContainText("0"); |
| 9 | + await page.getByTestId("max-chunks-input").click(); |
| 10 | + await page.getByTestId("max-chunks-input").press("ControlOrMeta+a"); |
| 11 | + await page.getByTestId("max-chunks-input").fill("5"); |
| 12 | + await page.getByTestId("item-size-input").click(); |
| 13 | + await page.getByTestId("item-size-input").press("ControlOrMeta+a"); |
| 14 | + await page.getByTestId("item-size-input").fill("3"); |
| 15 | + await page.goto("http://localhost:3000/#size=3"); |
| 16 | + await page.getByTestId("item-size-input").fill("32"); |
| 17 | + await page.goto("http://localhost:3000/#size=32"); |
| 18 | + await page.getByTestId("item-size-input").fill("320"); |
| 19 | + await page.goto("http://localhost:3000/#size=320"); |
| 20 | + await page.getByTestId("item-size-input").fill("3200"); |
| 21 | + await page.goto("http://localhost:3000/#size=3200"); |
| 22 | + await page.getByTestId("set-item-button").click(); |
| 23 | + await expect(page.getByTestId("hash1").locator("span")).toContainText( |
| 24 | + "------" |
| 25 | + ); |
| 26 | + await page.getByTestId("count-button").click(); |
| 27 | + await expect(page.getByTestId("count-value")).toContainText("0"); |
| 28 | + await page.getByTestId("get-item-button").click(); |
| 29 | + await expect(page.getByTestId("hash2").locator("span")).toContainText( |
| 30 | + "------" |
| 31 | + ); |
| 32 | +}); |
0 commit comments