mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-16 14:16:16 -08:00
refactor: auto-update mechanism
This commit is contained in:
1 parent
02192a73be
commit
e0c6eb6790
9 files changed
+207
-89
No files matched your search
@@ -11,11 +11,13 @@ import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
|
||||
import { MockModule, MockPipe, MockProviders } from 'ng-mocks';
|
||||
import { NgxIndexedDBService } from 'ngx-indexed-db';
|
||||
import { NgxWhatsNewModule } from 'ngx-whats-new';
|
||||
import { of } from 'rxjs';
|
||||
import { AppComponent } from './app.component';
|
||||
import { DataService } from './services/data.service';
|
||||
import { ElectronServiceStub } from './services/electron.service.stub';
|
||||
import { PlaylistsService } from './services/playlists.service';
|
||||
import { SettingsService } from './services/settings.service';
|
||||
import { WhatsNewService } from './services/whats-new.service';
|
||||
import { WhatsNewServiceStub } from './services/whats-new.service.stub';
|
||||
@@ -23,10 +25,6 @@ import { Language } from './settings/language.enum';
|
||||
import { Theme } from './settings/theme.enum';
|
||||
import { STORE_KEY } from './shared/enums/store-keys.enum';
|
||||
|
||||
class MatSnackBarStub {
|
||||
open(): void {}
|
||||
}
|
||||
|
||||
jest.spyOn(global.console, 'error').mockImplementation(() => {});
|
||||
|
||||
describe('AppComponent', () => {
|
||||
@@ -43,10 +41,14 @@ describe('AppComponent', () => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [AppComponent, MockPipe(TranslatePipe)],
|
||||
providers: [
|
||||
{ provide: MatSnackBar, useClass: MatSnackBarStub },
|
||||
{ provide: WhatsNewService, useClass: WhatsNewServiceStub },
|
||||
MockProviders(TranslateService),
|
||||
SettingsService, // TODO: stub
|
||||
MockProviders(
|
||||
TranslateService,
|
||||
PlaylistsService,
|
||||
NgxIndexedDBService,
|
||||
MatSnackBar
|
||||
),
|
||||
SettingsService,
|
||||
{
|
||||
provide: DataService,
|
||||
useClass: ElectronServiceStub,
|
||||
@@ -70,6 +72,9 @@ describe('AppComponent', () => {
|
||||
translateService = TestBed.inject(TranslateService);
|
||||
whatsNewService = TestBed.inject(WhatsNewService);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
// TODO: investigate in detail
|
||||
component.triggerAutoUpdateMechanism = jest.fn();
|
||||
component.modals = [];
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user