|
@@ -110,4 +110,19 @@ describe('modalApi', () => {
|
|
|
expect(modalApi.store.state.title).toBe('Batch Title');
|
|
|
expect(modalApi.store.state.confirmText).toBe('Batch Confirm');
|
|
|
});
|
|
|
+
|
|
|
+ it('should call onClosed callback when provided', () => {
|
|
|
+ const onClosed = vi.fn();
|
|
|
+ const modalApiWithHook = new ModalApi({ onClosed });
|
|
|
+ modalApiWithHook.onClosed();
|
|
|
+ expect(onClosed).toHaveBeenCalled();
|
|
|
+ });
|
|
|
+
|
|
|
+ it('should call onOpened callback when provided', () => {
|
|
|
+ const onOpened = vi.fn();
|
|
|
+ const modalApiWithHook = new ModalApi({ onOpened });
|
|
|
+ modalApiWithHook.open();
|
|
|
+ modalApiWithHook.onOpened();
|
|
|
+ expect(onOpened).toHaveBeenCalled();
|
|
|
+ });
|
|
|
});
|