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
@@ -1,17 +1,21 @@
import { describe, expect, it } from 'vitest';
import type { ThemeName } from '../../src/config/schema/view';
import { MountedCardFactory } from '../browser/mounted-card';
import { createCameraHASS, createStillImageCardConfig } from '../browser/test-utils';
import {
createGenericCameraHASS,
createStillImageCardConfig,
} from '../browser/test-utils';
// A colour the dark theme sets and the card carries no other way. Reading it
// back proves the stylesheet reached the card rather than merely compiling.
// See src/scss/themes/dark.scss .
const DARK_PRIMARY_BACKGROUND = '#111111';
const mountThemed = async (themes: string[]) =>
const mountThemed = async (themes: ThemeName[]) =>
await MountedCardFactory.createFromSource(
createStillImageCardConfig({ view: { theme: { themes } } }),
createCameraHASS(),
createGenericCameraHASS(),
);
describe('themes', () => {