Skip to content
Snippets Groups Projects
Commit 12b472ce authored by Maël QUAISSARD's avatar Maël QUAISSARD Committed by Gaëlle FOURNIER
Browse files

VITAMUI-127 : fix front TU

parent e960fd51
No related branches found
No related tags found
No related merge requests found
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef, MatOptionModule, MatProgressBarModule, MatSelectModule } from '@angular/material';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { EMPTY } from 'rxjs';
import { BASE_URL, ConfirmDialogService, ENVIRONMENT, LoggerModule, VitamUICommonModule } from 'ui-frontend-common';
import { environment } from '../../../environments/environment';
import { ContextCreateValidators } from '../context-create/context-create.validators';
import { ContextEditPermissionModule } from '../context-create/context-edit-permission/context-edit-permission.module';
import { ContextEditComponent } from './context-edit.component';
describe('ContextEditComponent', () => {
......@@ -7,8 +15,31 @@ describe('ContextEditComponent', () => {
let fixture: ComponentFixture<ContextEditComponent>;
beforeEach(async(() => {
const matDialogRefSpy = jasmine.createSpyObj('MatDialogRef', ['close', 'keydownEvents']);
TestBed.configureTestingModule({
declarations: [ ContextEditComponent ]
declarations: [
ContextEditComponent
],
imports: [
NoopAnimationsModule,
LoggerModule.forRoot(),
ReactiveFormsModule,
MatDialogModule,
MatProgressBarModule,
MatSelectModule,
MatOptionModule,
VitamUICommonModule,
ContextEditPermissionModule
],
providers: [
ContextCreateValidators,
{provide: MatDialogRef, useValue: matDialogRefSpy},
{provide: MAT_DIALOG_DATA, value: ''},
{provide: BASE_URL, useValue: ''},
{provide: ConfirmDialogService, useValue: {listenToEscapeKeyPress: () => EMPTY}},
{provide: ENVIRONMENT, useValue: environment}
]
})
.compileComponents();
}));
......
import { TestBed } from '@angular/core/testing';
import { async, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { BASE_URL } from 'ui-frontend-common';
import { CustomerApiService } from './customer-api.service';
describe('CustomerApiService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
HttpClientTestingModule,
],
providers: [
{provide: BASE_URL, useValue: ''},
],
}).compileComponents();
}));
it('should be created', () => {
const service: CustomerApiService = TestBed.get(CustomerApiService);
......
import { TestBed } from '@angular/core/testing';
import { async, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { BASE_URL } from 'ui-frontend-common';
import { TenantApiService } from './tenant-api.service';
describe('TenantApiService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
HttpClientTestingModule,
],
providers: [
{provide: BASE_URL, useValue: ''},
],
}).compileComponents();
}));
it('should be created', () => {
const service: TenantApiService = TestBed.get(TenantApiService);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment