Skip to content

Commit 5f75536

Browse files
mgoudy91claude
andauthored
fix: mock MuxPlayer in tests to prevent jsdom Web Component errors (#10858)
The @mux/mux-player Web Component crashes jsdom with `r.addEventListener is not a function` when mounted during tests, causing 12 unhandled errors and CI failure despite all tests passing. Mocking the component prevents it from mounting in the test environment. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a0db4e0 commit 5f75536

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/mux/frontend/src/index.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ vi.mock('contentful-management', () => ({
1919
})),
2020
}));
2121

22+
// Mock MuxPlayer to avoid Web Component errors in jsdom
23+
vi.mock('@mux/mux-player-react', () => ({
24+
default: vi.fn(() => null),
25+
}));
26+
2227
// Mock the API client
2328
vi.mock('./util/apiClient', () => ({
2429
default: vi.fn().mockImplementation(() => ({

0 commit comments

Comments
 (0)