mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
28 lines
1.2 KiB
JavaScript
28 lines
1.2 KiB
JavaScript
const { test, expect } = require("@playwright/test");
|
|
const { resolveTimeout } = require("./timeouts");
|
|
|
|
const { assertCspResponseHeader, assertCspMetaParity, gotoOnion } = require("./personas");
|
|
|
|
exports.register = function (shared) {
|
|
test("guest: Jellyfin web reachable, serves CSP, never reaches an authenticated surface", async ({ page }) => {
|
|
const response = await gotoOnion(page, `${shared.env.jellyfinBaseUrl}/web/`);
|
|
expect(response, "Expected a Jellyfin web response").toBeTruthy();
|
|
expect(response.status(), "Expected Jellyfin web status to be < 400").toBeLessThan(400);
|
|
expect(
|
|
response.url().includes(shared.env.canonicalDomain),
|
|
`Expected canonical domain "${shared.env.canonicalDomain}" to back the Jellyfin URL`,
|
|
).toBe(true);
|
|
|
|
const directives = assertCspResponseHeader(response, "jellyfin web");
|
|
await assertCspMetaParity(page, directives, "jellyfin web");
|
|
|
|
await expect
|
|
.poll(() => shared.onLoginSurface(page), {
|
|
timeout: resolveTimeout(30_000),
|
|
message: "guest must remain on the Jellyfin login surface",
|
|
})
|
|
.toBe(true);
|
|
await expect(page.locator(".headerUserButton")).toHaveCount(0);
|
|
});
|
|
};
|