test: Split browser test-utils (#2662)

- Closes: #2660
This commit is contained in:
Dermot Duffy
2026-08-07 16:27:28 -07:00
committed by GitHub
parent 673d8fe133
commit 8d8d486afa
9 changed files with 161 additions and 166 deletions
@@ -1,16 +1,13 @@
import { describe, expect, it, onTestFinished } from 'vitest';
import { createLogAction } from '../../src/utils/action';
import { deepQueryAll, getFocusedElement, pressKey, pressTab } from '../browser/dom';
import { MountedCardFactory, type MountedCard } from '../browser/mounted-card';
import {
CARD_INITIALIZED_MESSAGE,
createGenericCameraHASS,
createInitializedAutomation,
createStillImageCardConfig,
deepQueryAll,
getFocusedElement,
pressKey,
pressTab,
} from '../browser/test-utils';
// What the automation writes when it runs, written as the pattern the console
@@ -5,23 +5,24 @@ import { LIVENESS_ENTITY_UNAVAILABLE_GRACE_SECONDS } from '../../../../src/compo
import { MEDIA_LOADING_TIMEOUT_SECONDS } from '../../../../src/components-lib/media-load-watchdog-controller';
import { FRAME_STALL_SECONDS } from '../../../../src/components-lib/media-player/frame-stall-watchdog';
import type { RawAdvancedCameraCardConfig } from '../../../../src/config/types';
import { deepQuery, deepQueryAll } from '../../../browser/dom';
import {
MountedCardFactory,
type MountedCard,
type MountOptions,
} from '../../../browser/mounted-card';
import { useTestMedia } from '../../../browser/test-media';
import {
CAMERA_ENTITY,
createFailingMediaURL,
createGenericCameraHASS,
createStallingMediaURL,
createStillImageCameraConfig,
createStillImageCardConfig,
createTemporarilyFailingMediaURL,
createUnansweredMediaURL,
deepQuery,
deepQueryAll,
useTestMedia,
} from '../../../browser/test-media';
import {
CAMERA_ENTITY,
createGenericCameraHASS,
createStillImageCameraConfig,
createStillImageCardConfig,
getBlockNotificationText,
getStatusBarItem,
isLiveMediaShowing,
@@ -2,6 +2,14 @@ import { assert, describe, expect, it } from 'vitest';
import type { LogActionConfig } from '../../src/config/schema/actions/custom/log';
import { createLogAction } from '../../src/utils/action';
import {
clickElement,
dispatchPointerDown,
getFocusedElement,
holdKey,
pressKey,
releaseKey,
} from '../browser/dom';
import {
MountedCardFactory,
type MountedCard,
@@ -9,15 +17,9 @@ import {
} from '../browser/mounted-card';
import {
CARD_INITIALIZED_MESSAGE,
clickElement,
createGenericCameraHASS,
createInitializedAutomation,
createStillImageCardConfig,
dispatchPointerDown,
getFocusedElement,
holdKey,
pressKey,
releaseKey,
} from '../browser/test-utils';
const ZOOM_ENTITY = 'input_boolean.zoom';