Fix screen share player fallback width

This commit is contained in:
illusia committed 2026-10-12 08:10:17 +08:00
1 parent a4e54d6341
commit 42190909e3
4 files changed
+25 -2

No files matched your search

+8
View File
@@ -1,6 +1,7 @@
import assert from "node:assert/strict";
import { before, after, test } from "node:test";
import { fileURLToPath } from "node:url";
import { readFile } from "node:fs/promises";
import vue from "@vitejs/plugin-vue";
import { createServer } from "vite";
import { createRenderer, createSSRApp, nextTick, shallowRef, markRaw } from "vue";
@@ -46,6 +47,13 @@ test("screen-share player dimensions follow source orientation and stay inside t
assert.equal(calculateScreenSharePlayerSize(0, 1080, 1100, 720), null);
});
test("screen-share player keeps a visible fallback width while video metadata is pending", async () => {
const css = await readFile(new URL("../src/styles/web-client.css", import.meta.url), "utf8");
const playerRule = css.match(/:deep\(\.screen-share-player\)\s*\{([^}]*)\}/)?.[1] ?? "";
assert.match(playerRule, /width:\s*min\(100%,\s*1100px\)/);
assert.doesNotMatch(playerRule, /width:\s*fit-content/);
});
test("unmount detaches video and retires a pending binding without stopping its stream", async t => {
let stops = 0; const media = { getTracks: () => [{ stop: () => stops++ }] }, f = mount(t, media);
try { const video = f.video(); f.ui.setVideoElement(video); await nextTick();