test: Split test utilities to improve test times (#2622)

This commit is contained in:
Dermot Duffy
2026-07-26 16:29:53 -07:00
committed by GitHub
parent 8d44fcecf1
commit ad89aa9538
234 changed files with 2730 additions and 2516 deletions
+6 -4
View File
@@ -113,7 +113,7 @@ describe('CardController', () => {
const controller = new CardController(element, scrollCallback, menuToggleCallback);
expect(CardElementManager).toBeCalledWith(
expect(CardElementManager).toHaveBeenCalledWith(
controller,
element,
scrollCallback,
@@ -137,7 +137,9 @@ describe('CardController', () => {
const csmListener = calls[0][0];
const hass = {} as Parameters<typeof csmListener>[0];
csmListener(hass, null);
expect(vi.mocked(ConditionStateManager).mock.instances[0].setState).toBeCalledWith({
expect(
vi.mocked(ConditionStateManager).mock.instances[0].setState,
).toHaveBeenCalledWith({
hass,
});
});
@@ -372,14 +374,14 @@ describe('CardController', () => {
createController().hostConnected();
expect(
vi.mocked(CardElementManager).mock.instances[0].elementConnected,
).toBeCalled();
).toHaveBeenCalled();
});
it('should handle hostDisconnected', () => {
createController().hostDisconnected();
expect(
vi.mocked(CardElementManager).mock.instances[0].elementDisconnected,
).toBeCalled();
).toHaveBeenCalled();
});
});
});