Hashless assets (#4312)
* add support for external assets * fix playwright tests * add more documentation to with_hash_suffix * restore external asset hashing tests * Update gtk workflow dependencies * fix doc test * multiple versions of libgtk * clear dx in playwright tests * fix fullstack caching test * try without apt cache * cache everything except libxdo-dev * revert ci changes * fix wasm asset options * fix merge conflict * recommend the used attribute instead * Move options to AssetOptionsBuilder * Don't deprecate non-canonical new asset options functions --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
0bd376b873
commit
e74c838441
22 files changed
+569
-316
No files matched your search
@@ -23,4 +23,25 @@ test("optimized scripts run", async ({ page }) => {
|
||||
|
||||
// Expect the urls to be different
|
||||
expect(src).not.toEqual(src2);
|
||||
|
||||
// Expect the page to contain an image with the id "some_image_without_hash"
|
||||
const image3 = page.locator("#some_image_without_hash");
|
||||
await expect(image3).toBeVisible();
|
||||
// Get the image src
|
||||
const src3 = await image3.getAttribute("src");
|
||||
// Expect the src to be without a hash
|
||||
expect(src3).toEqual("/assets/toasts.avif");
|
||||
});
|
||||
|
||||
test("unused external assets are bundled", async ({ page }) => {
|
||||
await page.goto("http://localhost:8989");
|
||||
|
||||
// Assert http://localhost:8989/assets/toasts.png is found even though it is not used in the page
|
||||
const response = await page.request.get(
|
||||
"http://localhost:8989/assets/toasts.png"
|
||||
);
|
||||
// Expect the response to be ok
|
||||
expect(response.status()).toBe(200);
|
||||
// make sure the response is an image
|
||||
expect(response.headers()["content-type"]).toBe("image/png");
|
||||
});
|
||||
Reference in new issue
Block a user