Bump prettier to v3 and format all files
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import { expect, it } from "vitest";
|
||||
import { DefaultAction } from "../../../../src/card-controller/actions/actions/default";
|
||||
import { createCardAPI } from "../../../test-utils";
|
||||
import { expect, it } from 'vitest';
|
||||
import { DefaultAction } from '../../../../src/card-controller/actions/actions/default';
|
||||
import { createCardAPI } from '../../../test-utils';
|
||||
|
||||
it('should handle default action', async () => {
|
||||
const api = createCardAPI();
|
||||
const action = new DefaultAction({}, {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'default',
|
||||
});
|
||||
const action = new DefaultAction(
|
||||
{},
|
||||
{
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'default',
|
||||
},
|
||||
);
|
||||
|
||||
await action.execute(api);
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import { expect, it } from "vitest";
|
||||
import { DisplayModeSelectAction } from "../../../../src/card-controller/actions/actions/display-mode-select";
|
||||
import { createCardAPI } from "../../../test-utils";
|
||||
import { expect, it } from 'vitest';
|
||||
import { DisplayModeSelectAction } from '../../../../src/card-controller/actions/actions/display-mode-select';
|
||||
import { createCardAPI } from '../../../test-utils';
|
||||
|
||||
it('should handle default action', async () => {
|
||||
const api = createCardAPI();
|
||||
const action = new DisplayModeSelectAction({}, {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'display_mode_select',
|
||||
display_mode: 'grid',
|
||||
});
|
||||
const action = new DisplayModeSelectAction(
|
||||
{},
|
||||
{
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'display_mode_select',
|
||||
display_mode: 'grid',
|
||||
},
|
||||
);
|
||||
|
||||
await action.execute(api);
|
||||
|
||||
|
||||
@@ -430,15 +430,12 @@ describe('should handle ptz action', () => {
|
||||
);
|
||||
|
||||
const context = {};
|
||||
const startAction = new PTZAction(
|
||||
context,
|
||||
{
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz',
|
||||
ptz_action: 'left',
|
||||
ptz_phase: 'start',
|
||||
},
|
||||
);
|
||||
const startAction = new PTZAction(context, {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz',
|
||||
ptz_action: 'left',
|
||||
ptz_phase: 'start',
|
||||
});
|
||||
await startAction.execute(api);
|
||||
|
||||
expect(api.getCameraManager().executePTZAction).toBeCalledWith(
|
||||
@@ -450,25 +447,22 @@ describe('should handle ptz action', () => {
|
||||
);
|
||||
expect(api.getCameraManager().executePTZAction).toBeCalledTimes(1);
|
||||
|
||||
await vi.runOnlyPendingTimersAsync()
|
||||
await vi.runOnlyPendingTimersAsync();
|
||||
expect(api.getCameraManager().executePTZAction).toBeCalledTimes(2);
|
||||
|
||||
await vi.runOnlyPendingTimersAsync()
|
||||
await vi.runOnlyPendingTimersAsync();
|
||||
expect(api.getCameraManager().executePTZAction).toBeCalledTimes(3);
|
||||
|
||||
const stopAction = new PTZAction(
|
||||
context,
|
||||
{
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz',
|
||||
ptz_action: 'left',
|
||||
ptz_phase: 'stop',
|
||||
},
|
||||
);
|
||||
const stopAction = new PTZAction(context, {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz',
|
||||
ptz_action: 'left',
|
||||
ptz_phase: 'stop',
|
||||
});
|
||||
await stopAction.execute(api);
|
||||
|
||||
// There should be no additional calls.
|
||||
await vi.runOnlyPendingTimersAsync()
|
||||
await vi.runOnlyPendingTimersAsync();
|
||||
expect(api.getCameraManager().executePTZAction).toBeCalledTimes(3);
|
||||
});
|
||||
|
||||
@@ -500,11 +494,11 @@ describe('should handle ptz action', () => {
|
||||
await action.execute(api);
|
||||
expect(api.getCameraManager().executePTZAction).toBeCalledTimes(1);
|
||||
|
||||
await vi.runOnlyPendingTimersAsync()
|
||||
await vi.runOnlyPendingTimersAsync();
|
||||
expect(api.getCameraManager().executePTZAction).toBeCalledTimes(2);
|
||||
|
||||
action.stop();
|
||||
await vi.runOnlyPendingTimersAsync()
|
||||
await vi.runOnlyPendingTimersAsync();
|
||||
|
||||
// There should be no additional calls.
|
||||
expect(api.getCameraManager().executePTZAction).toBeCalledTimes(2);
|
||||
|
||||
@@ -18,7 +18,7 @@ it('should handle sleep action', async () => {
|
||||
frigate_card_action: 'sleep',
|
||||
duration: {
|
||||
s: 5,
|
||||
ms: 200
|
||||
ms: 200,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user