test: Add browser tests for the media viewing gallery and viewer (#2661)

This commit is contained in:
Dermot Duffy
2026-08-07 16:08:56 -07:00
committed by GitHub
parent 567690831c
commit 673d8fe133
25 changed files with 1563 additions and 144 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ import {
type MountOptions,
} from '../browser/mounted-card';
import {
createCameraHASS,
createGenericCameraHASS,
createStillImageCardConfig,
isLiveMediaShowing,
} from '../browser/test-utils';
@@ -99,7 +99,7 @@ class BuildMountedCardFactory extends MountedCardFactory {
* rather than from `src/`.
*/
const mountBuiltCard = async (
hass: FakeHASS = createCameraHASS(),
hass: FakeHASS = createGenericCameraHASS(),
): Promise<MountedCard> =>
await BuildMountedCardFactory.createFromBuild(
`/${PUBLIC_ENTRY}?hacstag=${HACSTAG}`,
@@ -243,7 +243,7 @@ describe('the built card', () => {
// Clear resource timings to only measure the impact of mounting the card.
performance.clearResourceTimings();
const mounted = await mountBuiltCard(createCameraHASS({ language: 'de' }));
const mounted = await mountBuiltCard(createGenericCameraHASS({ language: 'de' }));
await mounted.events.waitForFirst('advanced-camera-card:media:loaded');
expect(getLanguageChunks()).toEqual([expect.stringMatching(/^lang-de-/)]);