Skip to content

Commit f484e0f

Browse files
committed
#3414 webpage: addapt viewport test
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent 5e42bd9 commit f484e0f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

webpage/tests/head-tags.spec.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,10 @@ test("blog head tags - viewport meta tag", async ({ page, config }) => {
131131
config.baseURL + "/blog/2024-05-17-AI-support-was-added-to-QOwnNotes.html",
132132
);
133133

134-
const viewport = page.locator('meta[name="viewport"]');
135-
await expect(viewport).toHaveAttribute(
136-
"content",
137-
"width=device-width, initial-scale=1.0",
138-
);
134+
const viewport = page.locator('meta[name="viewport"]').first();
135+
const content = await viewport.getAttribute("content");
136+
// Accept both formats: "width=device-width,initial-scale=1" and "width=device-width, initial-scale=1.0"
137+
expect(content).toMatch(/width=device-width,?\s?initial-scale=1(\.0)?/);
139138
});
140139

141140
test("blog head tags - theme color", async ({ page, config }) => {

0 commit comments

Comments
 (0)