fix: Increase reliability of media auto actions (e.g. play) (#1934)

Refactors media player handling entirely to make the code more
consistent and less boilerplate. Add testing for media player actions.

- Closes #1921
- Closes #1916
This commit is contained in:
Dermot Duffy
2025-03-03 20:59:01 -08:00
committed by GitHub
parent d4650eae8a
commit 3b77b11196
58 changed files with 1972 additions and 1165 deletions
+9
View File
@@ -473,6 +473,15 @@ export const createLitElement = (): LitElement => {
const element = document.createElement('div') as unknown as LitElement;
element.addController = vi.fn();
element.requestUpdate = vi.fn();
const promise: Promise<boolean> = new Promise((resolve) => {
resolve(false);
});
// Need to overwrite a read-only property.
Object.defineProperty(element, 'updateComplete', {
value: promise,
});
return element;
};