fix: twind styles not updated on partial nav (#2017)

This commit is contained in:
Marvin Hagemeister
2023-11-06 14:04:43 +01:00
committed by GitHub
parent 8b846816a6
commit c172af67cf
7 changed files with 96 additions and 34 deletions
+20
View File
@@ -3,6 +3,7 @@ import { assert, assertEquals, assertMatch, delay, puppeteer } from "./deps.ts";
import { cmpStringArray } from "./fixture_twind_hydrate/utils/utils.ts";
import {
startFreshServer,
waitForStyle,
withFakeServe,
withFresh,
withPageName,
@@ -385,3 +386,22 @@ Deno.test("don't duplicate css class with twindV1", async () => {
},
);
});
Deno.test("render styles from partial update", async () => {
await withPageName(
"./tests/fixture_twind_hydrate/main.ts",
async (page, address) => {
await page.goto(`${address}/island_twind`);
await page.click(`a[href="/island_twind/blue"]`);
await page.waitForSelector(".bg-blue-500");
await waitForStyle(
page,
".bg-blue-500",
"backgroundColor",
"rgb(59, 130, 246)",
);
},
);
});