Skip to content

Commit

Permalink
fix: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 2, 2020
1 parent 6532c52 commit 59a1da5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/app/features/atom-dialog/atom-dialog.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';

import { AtomDialogComponent } from './atom-dialog.component';
import { SharedModule } from '../../shared/shared.module';
Expand All @@ -10,6 +11,10 @@ describe('AtomDialogComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [SharedModule],
providers: [
{ provide: MAT_DIALOG_DATA, useValue: {} },
{ provide: MatDialogRef, useValue: {} },
],
declarations: [AtomDialogComponent],
}).compileComponents();
}));
Expand Down
12 changes: 9 additions & 3 deletions src/app/features/atom/atom.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';

import { AtomComponent } from './atom.component';
import { SharedModule } from '../../shared/shared.module';

describe('AtomComponent', () => {
let component: AtomComponent;
let fixture: ComponentFixture<AtomComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AtomComponent ]
})
.compileComponents();
imports: [SharedModule],
providers: [
{ provide: MAT_DIALOG_DATA, useValue: {} },
{ provide: MatDialogRef, useValue: {} },
],
declarations: [AtomComponent],
}).compileComponents();
}));

beforeEach(() => {
Expand Down
9 changes: 7 additions & 2 deletions src/app/shared/custom-material.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatSliderModule } from '@angular/material/slider';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatIconModule } from '@angular/material/icon';
import { MatDialogModule } from '@angular/material/dialog';
import {
MAT_DIALOG_DEFAULT_OPTIONS,
MatDialogModule,
} from '@angular/material/dialog';

const modules = [
MatToolbarModule,
Expand All @@ -22,7 +25,9 @@ const modules = [
@NgModule({
imports: modules,
declarations: [],
providers: [],
providers: [
{ provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { hasBackdrop: true } },
],
exports: modules,
entryComponents: [],
})
Expand Down

0 comments on commit 59a1da5

Please sign in to comment.