mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 11:33:04 +00:00
90252: Ensure modals are dismissed between tests
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
|||||||
BrowserDynamicTestingModule,
|
BrowserDynamicTestingModule,
|
||||||
platformBrowserDynamicTesting
|
platformBrowserDynamicTesting
|
||||||
} from '@angular/platform-browser-dynamic/testing';
|
} from '@angular/platform-browser-dynamic/testing';
|
||||||
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
declare const require: any;
|
declare const require: any;
|
||||||
|
|
||||||
@@ -17,9 +18,11 @@ getTestBed().initTestEnvironment(
|
|||||||
{ teardown: { destroyAfterEach: false } }
|
{ teardown: { destroyAfterEach: false } }
|
||||||
);
|
);
|
||||||
|
|
||||||
// If store is mocked, reset state after each test (see https://ngrx.io/guide/migration/v13)
|
|
||||||
jasmine.getEnv().afterEach(() => {
|
jasmine.getEnv().afterEach(() => {
|
||||||
|
// If store is mocked, reset state after each test (see https://ngrx.io/guide/migration/v13)
|
||||||
getTestBed().inject(MockStore, null)?.resetSelectors();
|
getTestBed().inject(MockStore, null)?.resetSelectors();
|
||||||
|
// Close any leftover modals
|
||||||
|
getTestBed().inject(NgbModal, null)?.dismissAll?.();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Then we find all the tests.
|
// Then we find all the tests.
|
||||||
|
Reference in New Issue
Block a user