refactor: Retire the use of unmaintained custom-card-helpers (#1956)

- Closes #1295
This commit is contained in:
Dermot Duffy
2025-03-09 16:02:33 -07:00
committed by GitHub
parent c65ee3f0f2
commit a79ffa6edc
116 changed files with 933 additions and 545 deletions
+24
View File
@@ -0,0 +1,24 @@
import { describe, expect, it, vi } from 'vitest';
import { fireHASSEvent } from '../../src/ha/fire-hass-event.js';
import { forwardHaptic, HapticType } from '../../src/ha/haptic.js';
vi.mock('../../src/ha/fire-hass-event.js', () => ({
fireHASSEvent: vi.fn(),
}));
// @vitest-environment jsdom
describe('forwardHaptic', () => {
it.each([
['success' as const],
['warning' as const],
['failure' as const],
['light' as const],
['medium' as const],
['heavy' as const],
['selection' as const],
])('should call fireHASSEvent with %s', (hapticType: HapticType) => {
forwardHaptic(hapticType);
expect(fireHASSEvent).toBeCalledWith(window, 'haptic', hapticType);
});
});