Merge branch 'unstable' into agents/daily/onboarding-audit-2026-02-22-6501903614915901077

This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-22 15:40:28 -05:00
commit 6ed296f2d2
11 files changed
+9548 -40

No files matched your search

@@ -83,6 +83,7 @@ test.describe("Accessibility and keyboard navigation", () => {
// When: login button receives focus and Enter is pressed
const loginBtn = page.locator('[data-testid="login-button"]');
await expect(loginBtn).toBeVisible();
await loginBtn.focus();
await page.keyboard.press("Enter");
+5
View File
@@ -133,6 +133,11 @@ async function gotoWithTestMode(page: Page, relayUrl: string, path = "/") {
() => typeof (window as any).__bitvidTest__ === "object",
{ timeout: 15000 },
);
// Explicitly set test relays to ensure they are active and recognized by the relayManager patch
await page.evaluate((url) => {
(window as any).__bitvidTest__.setTestRelays([url], { persist: false });
}, relayUrl);
}
/**
+5
View File
@@ -98,6 +98,11 @@ test.describe("Login and authentication flows", () => {
(window as any).__bitvidTest__.logout();
});
// Wait for state to settle with a longer timeout
await page.waitForFunction(() => {
return (window as any).__bitvidTest__.getAppState().isLoggedIn === false;
}, { timeout: 15000 });
const loggedOut = await page.evaluate(() => {
return (window as any).__bitvidTest__.getAppState();
});
+32 -3
View File
@@ -35,6 +35,11 @@ test.describe("Video playback scenarios", () => {
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
});
// Wait for the modal element to be present in DOM before clicking
// This ensures event listeners (like VideoModalController's body click delegate)
// have likely been initialized by the app boot sequence.
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
// When: user clicks the video card
const card = page.locator("[data-video-card]").first();
await expect(card).toBeVisible();
@@ -65,6 +70,9 @@ test.describe("Video playback scenarios", () => {
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
});
// Wait for modal presence to ensure app is fully initialized
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
await page.locator("[data-video-card]").first().click();
const playerModal = page.locator("#playerModal");
@@ -101,6 +109,8 @@ test.describe("Video playback scenarios", () => {
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
});
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
// When: user opens the video
await page.locator("[data-video-card]").first().click();
@@ -147,6 +157,8 @@ test.describe("Video playback scenarios", () => {
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
});
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
// When: user opens the video
await page.locator("[data-video-card]").first().click();
@@ -195,15 +207,30 @@ test.describe("Video playback scenarios", () => {
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
});
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
await page.locator("[data-video-card]").first().click();
const playerModal = page.locator("#playerModal");
await expect(playerModal).not.toHaveClass(/hidden/, { timeout: 10000 });
// When: user closes the modal
// Try various close mechanisms
const closeBtn = page.locator(
"#playerModal .modal-close, #playerModal [data-close], #playerModal [data-dismiss], #closePlayerModal",
// Use the standard close button ID which is bound in VideoModal.js
const closeBtn = page.locator("#closeModal");
await closeBtn.waitFor({ state: "visible", timeout: 5000 });
await closeBtn.click();
// Then: modal is hidden again
await page.waitForFunction(
() => {
const modal = document.querySelector("#playerModal");
if (!modal) return true;
return (
modal.classList.contains("hidden") ||
modal.getAttribute("data-open") === "false"
);
},
{ timeout: 10000 },
);
if ((await closeBtn.count()) > 0) {
await closeBtn.first().click({ force: true });
@@ -240,6 +267,8 @@ test.describe("Video playback scenarios", () => {
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
});
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
// When: user opens the video
await page.locator("[data-video-card]").first().click();