Skip to content

Commit 9a40af9

Browse files
committed
fix(wiki-list): Fix tests
1 parent 03fdecb commit 9a40af9

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/app/shared/components/wiki/rename-wiki-dialog/rename-wiki-dialog.component.spec.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { Store } from '@ngxs/store';
2-
31
import { MockComponent, MockProvider } from 'ng-mocks';
42

53
import { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog';
@@ -13,21 +11,14 @@ import { TextInputComponent } from '../../text-input/text-input.component';
1311

1412
import { RenameWikiDialogComponent } from './rename-wiki-dialog.component';
1513

16-
import { MOCK_STORE } from '@testing/mocks/mock-store.mock';
1714
import { TranslateServiceMock } from '@testing/mocks/translate.service.mock';
15+
import { provideMockStore } from '@testing/providers/store-provider.mock';
1816

1917
describe('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

Comments
 (0)