test: Remove unnecessary jsdom environment declarations (#2616)
This commit is contained in:
@@ -80,7 +80,6 @@ const fireMessage = (hass: HomeAssistant, data: unknown, n = 0): void => {
|
|||||||
mock.calls[n][0](data);
|
mock.calls[n][0](data);
|
||||||
};
|
};
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('FrigateEventWatcher', () => {
|
describe('FrigateEventWatcher', () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.restoreAllMocks();
|
vi.restoreAllMocks();
|
||||||
@@ -226,7 +225,6 @@ describe('FrigateEventWatcher', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('FrigateReviewWatcher', () => {
|
describe('FrigateReviewWatcher', () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.restoreAllMocks();
|
vi.restoreAllMocks();
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @vitest-environment jsdom
|
|
||||||
import { endOfDay, startOfDay } from 'date-fns';
|
import { endOfDay, startOfDay } from 'date-fns';
|
||||||
import { afterEach, assert, describe, expect, it, vi } from 'vitest';
|
import { afterEach, assert, describe, expect, it, vi } from 'vitest';
|
||||||
import { mock, type MockProxy } from 'vitest-mock-extended';
|
import { mock, type MockProxy } from 'vitest-mock-extended';
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ import { GENERATED_ACTION } from '../../../src/config/schema/actions/custom/gene
|
|||||||
import { INTERNAL_CALLBACK_ACTION } from '../../../src/config/schema/actions/custom/internal';
|
import { INTERNAL_CALLBACK_ACTION } from '../../../src/config/schema/actions/custom/internal';
|
||||||
import type { ActionConfig } from '../../../src/config/schema/actions/types';
|
import type { ActionConfig } from '../../../src/config/schema/actions/types';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('ActionFactory', () => {
|
describe('ActionFactory', () => {
|
||||||
it('should return null for mismatched card-id', () => {
|
it('should return null for mismatched card-id', () => {
|
||||||
const factory = new ActionFactory();
|
const factory = new ActionFactory();
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// @vitest-environment jsdom
|
|
||||||
|
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||||
import { mock } from 'vitest-mock-extended';
|
import { mock } from 'vitest-mock-extended';
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import { createCardAPI, createConfig, createHASS } from '../test-utils';
|
|||||||
vi.mock('../../src/localize/localize.js');
|
vi.mock('../../src/localize/localize.js');
|
||||||
vi.mock('../../src/ha/side-load-ha-elements.js');
|
vi.mock('../../src/ha/side-load-ha-elements.js');
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('InitializationManager', () => {
|
describe('InitializationManager', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
vi.resetAllMocks();
|
vi.resetAllMocks();
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @vitest-environment jsdom
|
|
||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
import { createRetryControl } from '../../../src/card-controller/issues/retry-control';
|
import { createRetryControl } from '../../../src/card-controller/issues/retry-control';
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { describe, expect, it, vi } from 'vitest';
|
|||||||
import { SignalingChannel } from '../../../../../src/components-lib/live/providers/go2rtc-experimental/signaling';
|
import { SignalingChannel } from '../../../../../src/components-lib/live/providers/go2rtc-experimental/signaling';
|
||||||
import { FakeWebSocket } from './test-utils';
|
import { FakeWebSocket } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('SignalingChannel', () => {
|
describe('SignalingChannel', () => {
|
||||||
const setup = (options?: {
|
const setup = (options?: {
|
||||||
openCallback?: () => void;
|
openCallback?: () => void;
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ const calculateButtons = (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('MenuButtonController', () => {
|
describe('MenuButtonController', () => {
|
||||||
let controller: MenuButtonController;
|
let controller: MenuButtonController;
|
||||||
const dynamicButton: MenuItem = {
|
const dynamicButton: MenuItem = {
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ describe('generateViewContextForZoom', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('handleZoomSettingsObservedEvent', () => {
|
describe('handleZoomSettingsObservedEvent', () => {
|
||||||
it('should reject observed zoom settings without viewManager ', () => {
|
it('should reject observed zoom settings without viewManager ', () => {
|
||||||
handleZoomSettingsObservedEvent(
|
handleZoomSettingsObservedEvent(
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('and condition', () => {
|
describe('and condition', () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.restoreAllMocks();
|
vi.restoreAllMocks();
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
|||||||
import { callConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/call';
|
import { callConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/call';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('call condition', () => {
|
describe('call condition', () => {
|
||||||
it('should require a value', () => {
|
it('should require a value', () => {
|
||||||
expect(() => callConditionSchema.parse({ condition: 'call' })).toThrow();
|
expect(() => callConditionSchema.parse({ condition: 'call' })).toThrow();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('camera condition', () => {
|
describe('camera condition', () => {
|
||||||
it('should match a named camera', () => {
|
it('should match a named camera', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('display mode condition', () => {
|
describe('display mode condition', () => {
|
||||||
it('should match a display mode condition', () => {
|
it('should match a display mode condition', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
|||||||
import { expandConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/expand';
|
import { expandConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/expand';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('expand condition', () => {
|
describe('expand condition', () => {
|
||||||
it('should match an expand condition', () => {
|
it('should match an expand condition', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
|||||||
import { fullscreenConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/fullscreen';
|
import { fullscreenConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/fullscreen';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('fullscreen condition', () => {
|
describe('fullscreen condition', () => {
|
||||||
it('should match a fullscreen condition', () => {
|
it('should match a fullscreen condition', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('initialized condition', () => {
|
describe('initialized condition', () => {
|
||||||
it('should match an initialized condition', () => {
|
it('should match an initialized condition', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
|||||||
import { interactionConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/interaction';
|
import { interactionConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/interaction';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('interaction condition', () => {
|
describe('interaction condition', () => {
|
||||||
it('should match an interaction condition', () => {
|
it('should match an interaction condition', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('key condition', () => {
|
describe('key condition', () => {
|
||||||
it('should match a simple keypress', () => {
|
it('should match a simple keypress', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { mediaLoadedConditionSchema } from '../../../../src/config/schema/condit
|
|||||||
import { createMediaLoadedInfo } from '../../../test-utils';
|
import { createMediaLoadedInfo } from '../../../test-utils';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('media loaded condition', () => {
|
describe('media loaded condition', () => {
|
||||||
it('should match a media loaded condition', () => {
|
it('should match a media loaded condition', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import type { MicrophoneState } from '../../../../src/card-controller/types';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('microphone condition', () => {
|
describe('microphone condition', () => {
|
||||||
const createMicrophoneState = (state: Partial<MicrophoneState>): MicrophoneState => {
|
const createMicrophoneState = (state: Partial<MicrophoneState>): MicrophoneState => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('not condition', () => {
|
describe('not condition', () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.restoreAllMocks();
|
vi.restoreAllMocks();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('or condition', () => {
|
describe('or condition', () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.restoreAllMocks();
|
vi.restoreAllMocks();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('triggered condition', () => {
|
describe('triggered condition', () => {
|
||||||
it('should match any triggered camera when no list is given', () => {
|
it('should match any triggered camera when no list is given', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('user agent condition', () => {
|
describe('user agent condition', () => {
|
||||||
const userAgent =
|
const userAgent =
|
||||||
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
|
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
|||||||
import { createHASS, createUser } from '../../../test-utils';
|
import { createHASS, createUser } from '../../../test-utils';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('user condition', () => {
|
describe('user condition', () => {
|
||||||
it('should match a user condition', () => {
|
it('should match a user condition', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
|||||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||||
import { createEvaluatorContext } from './test-utils';
|
import { createEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('view condition', () => {
|
describe('view condition', () => {
|
||||||
it('should match a named view', () => {
|
it('should match a named view', () => {
|
||||||
const evaluator = createConditionEvaluator(
|
const evaluator = createConditionEvaluator(
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import { createHASSManager, createMockTemplateRenderer } from '../../test-utils'
|
|||||||
|
|
||||||
type TriggerEvaluatorConstructor = new (...args: never[]) => TriggerEvaluator;
|
type TriggerEvaluatorConstructor = new (...args: never[]) => TriggerEvaluator;
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('createTriggerEvaluator', () => {
|
describe('createTriggerEvaluator', () => {
|
||||||
const context = (): TriggerEvaluatorContext => ({
|
const context = (): TriggerEvaluatorContext => ({
|
||||||
stateManager: new ConditionStateManager(),
|
stateManager: new ConditionStateManager(),
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { CallTrigger } from '../../../../src/condition-trigger/triggers/triggers
|
|||||||
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('CallTrigger', () => {
|
describe('CallTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'call'>,
|
trigger: TriggerOfType<'call'>,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/t
|
|||||||
import { createConfig } from '../../../test-utils';
|
import { createConfig } from '../../../test-utils';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('CameraTrigger', () => {
|
describe('CameraTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'camera'>,
|
trigger: TriggerOfType<'camera'>,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/t
|
|||||||
import { createConfig } from '../../../test-utils';
|
import { createConfig } from '../../../test-utils';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('ConfigTrigger', () => {
|
describe('ConfigTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'config'>,
|
trigger: TriggerOfType<'config'>,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { DisplayModeTrigger } from '../../../../src/condition-trigger/triggers/t
|
|||||||
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('DisplayModeTrigger', () => {
|
describe('DisplayModeTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'display_mode'>,
|
trigger: TriggerOfType<'display_mode'>,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { ExpandTrigger } from '../../../../src/condition-trigger/triggers/trigge
|
|||||||
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('ExpandTrigger', () => {
|
describe('ExpandTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'expand'>,
|
trigger: TriggerOfType<'expand'>,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { FullscreenTrigger } from '../../../../src/condition-trigger/triggers/tr
|
|||||||
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('FullscreenTrigger', () => {
|
describe('FullscreenTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'fullscreen'>,
|
trigger: TriggerOfType<'fullscreen'>,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { InteractionTrigger } from '../../../../src/condition-trigger/triggers/t
|
|||||||
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('InteractionTrigger', () => {
|
describe('InteractionTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'interaction'>,
|
trigger: TriggerOfType<'interaction'>,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/t
|
|||||||
import { createMediaLoadedInfo } from '../../../test-utils';
|
import { createMediaLoadedInfo } from '../../../test-utils';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('MediaLoadedTrigger', () => {
|
describe('MediaLoadedTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'media_loaded'>,
|
trigger: TriggerOfType<'media_loaded'>,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { MicrophoneTrigger } from '../../../../src/condition-trigger/triggers/tr
|
|||||||
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('MicrophoneTrigger', () => {
|
describe('MicrophoneTrigger', () => {
|
||||||
const createMicrophoneState = (state: Partial<MicrophoneState>): MicrophoneState => ({
|
const createMicrophoneState = (state: Partial<MicrophoneState>): MicrophoneState => ({
|
||||||
connected: false,
|
connected: false,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { TriggeredTrigger } from '../../../../src/condition-trigger/triggers/tri
|
|||||||
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/triggers/types';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('TriggeredTrigger', () => {
|
describe('TriggeredTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'triggered'>,
|
trigger: TriggerOfType<'triggered'>,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import type { TriggerOfType } from '../../../../src/condition-trigger/triggers/t
|
|||||||
import { ViewTrigger } from '../../../../src/condition-trigger/triggers/triggers/view';
|
import { ViewTrigger } from '../../../../src/condition-trigger/triggers/triggers/view';
|
||||||
import { createTriggerEvaluatorContext } from './test-utils';
|
import { createTriggerEvaluatorContext } from './test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('ViewTrigger', () => {
|
describe('ViewTrigger', () => {
|
||||||
const create = (
|
const create = (
|
||||||
trigger: TriggerOfType<'view'>,
|
trigger: TriggerOfType<'view'>,
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import { customSchema } from '../../src/config/schema/elements/stock/custom';
|
|||||||
import { conditionalSchema } from '../../src/config/schema/elements/types';
|
import { conditionalSchema } from '../../src/config/schema/elements/types';
|
||||||
import { createConfig } from '../test-utils';
|
import { createConfig } from '../test-utils';
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('config defaults', () => {
|
describe('config defaults', () => {
|
||||||
it('should be as expected', () => {
|
it('should be as expected', () => {
|
||||||
expect(createConfig()).toEqual({
|
expect(createConfig()).toEqual({
|
||||||
|
|||||||
@@ -596,7 +596,6 @@ describe('getActionName', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('stopEventFromActivatingCardWideActions', () => {
|
describe('stopEventFromActivatingCardWideActions', () => {
|
||||||
it('should stop event from propogating', () => {
|
it('should stop event from propogating', () => {
|
||||||
const event = mock<Event>();
|
const event = mock<Event>();
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ describe('getReleaseVersion', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// @vitest-environment jsdom
|
|
||||||
describe('getDiagnostics', () => {
|
describe('getDiagnostics', () => {
|
||||||
const now = new Date('2023-10-01T21:53Z');
|
const now = new Date('2023-10-01T21:53Z');
|
||||||
const hass = createHASS();
|
const hass = createHASS();
|
||||||
|
|||||||
Reference in New Issue
Block a user