Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lastminutediorama committed Dec 22, 2024
1 parent 5e0cd78 commit 5f57712
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ActivatedRoute, convertToParamMap } from '@angular/router';
import { UploadedScenarioViewComponent } from './uploaded-scenario-view.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { MatSnackBarModule } from '@angular/material/snack-bar';

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

beforeEach(async () => {
const fakeRoute = jasmine.createSpyObj(
'ActivatedRoute',
{},
{
snapshot: {
paramMap: convertToParamMap({ id: '1234567890' }),
},
}
);
await TestBed.configureTestingModule({
imports: [UploadedScenarioViewComponent]
})
.compileComponents();

imports: [HttpClientTestingModule, MatSnackBarModule],
providers: [
{ provide: ActivatedRoute, useValue: fakeRoute },
UploadedScenarioViewComponent,
],
}).compileComponents();

fixture = TestBed.createComponent(UploadedScenarioViewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down

0 comments on commit 5f57712

Please sign in to comment.