mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 04:42:57 +00:00
Merge branch 'unstable' into chore/ai/dependency-scan-report-750138199951940544
This commit is contained in:
12 files changed
+919
-384
No files matched your search
@@ -7,12 +7,15 @@ test.describe("embed layout and styling", () => {
|
||||
await page.goto("/embed.html?pointer=nevent123", { waitUntil: "domcontentloaded" });
|
||||
|
||||
// 1. Verify CSS Variable
|
||||
const accentColor = await page.evaluate(() => {
|
||||
return getComputedStyle(document.documentElement).getPropertyValue("--bitvid-accent").trim();
|
||||
});
|
||||
// The configured color is #540011 (from config/instance-config.js)
|
||||
const expectedAccent = THEME_ACCENT_OVERRIDES?.light?.accent || "#ff6b6b";
|
||||
expect(accentColor).toBe(expectedAccent);
|
||||
|
||||
// Wait for the accent color to be applied by js/embed.js
|
||||
await expect.poll(async () => {
|
||||
return page.evaluate(() => {
|
||||
return getComputedStyle(document.documentElement).getPropertyValue("--bitvid-accent").trim();
|
||||
});
|
||||
}).toBe(expectedAccent);
|
||||
|
||||
// 2. Verify Video Element Styling
|
||||
const video = page.locator("#embedVideo");
|
||||
|
||||
@@ -10,26 +10,12 @@ declare global {
|
||||
}
|
||||
|
||||
test.describe("overlay layering tokens", () => {
|
||||
async function dismissDisclaimerModal(page: Page) {
|
||||
const modal = page.locator("#disclaimerModal");
|
||||
if ((await modal.count()) === 0) {
|
||||
return;
|
||||
}
|
||||
test("mobile sidebar shares desktop rail behavior", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
|
||||
await page.evaluate(() => {
|
||||
try {
|
||||
window.localStorage?.setItem("hasSeenDisclaimer", "true");
|
||||
} catch (error) {
|
||||
console.warn("Failed to persist disclaimer state", error);
|
||||
}
|
||||
document
|
||||
.querySelectorAll<HTMLElement>("#disclaimerModal")
|
||||
.forEach((node) => {
|
||||
node.classList.add("hidden");
|
||||
node.setAttribute("data-open", "false");
|
||||
});
|
||||
document.documentElement?.classList.remove("modal-open");
|
||||
document.body?.classList.remove("modal-open");
|
||||
// Pre-suppress the disclaimer modal to avoid race conditions with app hydration
|
||||
await page.addInitScript(() => {
|
||||
window.localStorage.setItem("hasSeenDisclaimer", "true");
|
||||
});
|
||||
|
||||
await page.waitForFunction(() =>
|
||||
@@ -44,8 +30,6 @@ test.describe("overlay layering tokens", () => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await page.goto("/index.html", { waitUntil: "networkidle" });
|
||||
|
||||
await dismissDisclaimerModal(page);
|
||||
|
||||
// Wait for initial fade-in to complete so opacity doesn't interfere with visibility checks
|
||||
await page.waitForFunction(
|
||||
() => !document.getElementById("sidebar")?.classList.contains("fade-in")
|
||||
|
||||
Reference in new issue
Block a user