1- import { Store } from '@ngxs/store' ;
2-
31import { MockComponent , MockProvider } from 'ng-mocks' ;
42
53import { DynamicDialogConfig , DynamicDialogRef } from 'primeng/dynamicdialog' ;
@@ -13,21 +11,14 @@ import { TextInputComponent } from '../../text-input/text-input.component';
1311
1412import { RenameWikiDialogComponent } from './rename-wiki-dialog.component' ;
1513
16- import { MOCK_STORE } from '@testing/mocks/mock-store.mock' ;
1714import { TranslateServiceMock } from '@testing/mocks/translate.service.mock' ;
15+ import { provideMockStore } from '@testing/providers/store-provider.mock' ;
1816
1917describe ( 'RenameWikiDialogComponent' , ( ) => {
2018 let component : RenameWikiDialogComponent ;
2119 let fixture : ComponentFixture < RenameWikiDialogComponent > ;
2220
2321 beforeEach ( async ( ) => {
24- ( MOCK_STORE . selectSignal as jest . Mock ) . mockImplementation ( ( selector ) => {
25- if ( selector === WikiSelectors . getWikiSubmitting ) {
26- return ( ) => false ;
27- }
28- return ( ) => null ;
29- } ) ;
30-
3122 await TestBed . configureTestingModule ( {
3223 imports : [ RenameWikiDialogComponent , MockComponent ( TextInputComponent ) ] ,
3324 providers : [
@@ -40,7 +31,9 @@ describe('RenameWikiDialogComponent', () => {
4031 } ,
4132 } ) ,
4233 MockProvider ( ToastService ) ,
43- MockProvider ( Store , MOCK_STORE ) ,
34+ provideMockStore ( {
35+ selectors : [ { selector : WikiSelectors . getWikiSubmitting , value : false } ] ,
36+ } ) ,
4437 ] ,
4538 } ) . compileComponents ( ) ;
4639
0 commit comments