mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-16 14:16:16 -08:00
test: add missing dependency
This commit is contained in:
7 files changed
+62
-34
No files matched your search
@@ -1,11 +1,11 @@
|
||||
import { TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { AppComponent } from './app.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { TranslateModule, TranslatePipe } from '@ngx-translate/core';
|
||||
import { ElectronService } from './services/electron.service';
|
||||
import { ElectronServiceStub } from './home/home.component.spec';
|
||||
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { MockModule } from 'ng-mocks';
|
||||
import { MockModule, MockPipe } from 'ng-mocks';
|
||||
|
||||
jest.mock('custom-electron-titlebar', () => {
|
||||
return {
|
||||
@@ -23,24 +23,29 @@ class MatSnackBarStub {
|
||||
}
|
||||
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [AppComponent],
|
||||
providers: [
|
||||
{ provide: ElectronService, useClass: ElectronServiceStub },
|
||||
{ provide: MatSnackBar, useClass: MatSnackBarStub },
|
||||
],
|
||||
imports: [
|
||||
MockModule(MatSnackBarModule),
|
||||
RouterTestingModule,
|
||||
TranslateModule.forRoot(),
|
||||
],
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(
|
||||
waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [AppComponent, MockPipe(TranslatePipe)],
|
||||
providers: [
|
||||
{ provide: ElectronService, useClass: ElectronServiceStub },
|
||||
{ provide: MatSnackBar, useClass: MatSnackBarStub },
|
||||
],
|
||||
imports: [
|
||||
MockModule(MatSnackBarModule),
|
||||
RouterTestingModule,
|
||||
TranslateModule.forRoot(),
|
||||
],
|
||||
}).compileComponents();
|
||||
})
|
||||
);
|
||||
|
||||
it('should create the app', waitForAsync(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
}));
|
||||
it(
|
||||
'should create the app',
|
||||
waitForAsync(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
})
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user