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
@@ -29,7 +29,7 @@ describe('handleControlAction', () => {
const host = document.createElement('div');
handleControlAction(ev, createControl(), host);
expect(stopEventFromActivatingCardWideActions).toBeCalledWith(ev);
expect(stopEventFromActivatingCardWideActions).toHaveBeenCalledWith(ev);
});
it('should dispatch action when getActionConfigGivenAction returns an action', () => {
@@ -42,7 +42,7 @@ describe('handleControlAction', () => {
handleControlAction(ev, control, host);
expect(dispatchActionExecutionRequest).toBeCalledWith(host, {
expect(dispatchActionExecutionRequest).toHaveBeenCalledWith(host, {
actions: [action],
});
});
@@ -55,7 +55,7 @@ describe('handleControlAction', () => {
handleControlAction(ev, createControl(), host);
expect(dispatchActionExecutionRequest).not.toBeCalled();
expect(dispatchActionExecutionRequest).not.toHaveBeenCalled();
});
it('should call onDismiss when dismiss is not false', () => {
@@ -67,7 +67,7 @@ describe('handleControlAction', () => {
handleControlAction(ev, createControl({ dismiss: true }), host, onDismiss);
expect(onDismiss).toBeCalled();
expect(onDismiss).toHaveBeenCalled();
});
it('should not call onDismiss when dismiss is false', () => {
@@ -79,7 +79,7 @@ describe('handleControlAction', () => {
handleControlAction(ev, createControl({ dismiss: false }), host, onDismiss);
expect(onDismiss).not.toBeCalled();
expect(onDismiss).not.toHaveBeenCalled();
});
it('should not call onDismiss when no onDismiss is provided', () => {