mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-30 11:37:12 +00:00
This adds a <Link> astro component that can change the base url of links to work at the snapshot url or docs.slint.dev url. It also uses Playwright to test all the links.
23 lines
751 B
TypeScript
23 lines
751 B
TypeScript
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: MIT
|
|
import { test, expect } from "@playwright/test";
|
|
import { linkMap } from "../src/utils/utils";
|
|
|
|
test("Test all links", async ({ page }) => {
|
|
const baseUrl = "http://localhost:4321/master/docs/slint";
|
|
|
|
for (const [key, value] of Object.entries(linkMap)) {
|
|
const fullUrl = `${baseUrl}${value.href}`;
|
|
|
|
try {
|
|
const response = await page.request.get(fullUrl);
|
|
expect
|
|
.soft(response.ok(), `${fullUrl} has no green status code`)
|
|
.toBeTruthy();
|
|
} catch {
|
|
expect
|
|
.soft(null, `${fullUrl} has no green status code`)
|
|
.toBeTruthy();
|
|
}
|
|
}
|
|
});
|