I'm running my unit tests and seeing the actual application page below the results. It'd be nice if it had the styling applied to it, as the images etc go massive and it's not worth looking at.
Here is my setup code:
describe('ResultImageComponent', () => {
let fixture: ComponentFixture<UserAttributesCardComponent>;
let component: UserAttributesCardComponent;
let element: HTMLElement;
let result: Result;
let page: Page;
beforeAll(() => {
TestBed.resetTestEnvironment();
TestBed.initTestEnvironment(BrowserDynamicTestingModule,
platformBrowserDynamicTesting());
});
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [UserAttributesCardComponent],
}).compileComponents();
}));
beforeEach(async(() => {
fixture = TestBed.createComponent(UserAttributesCardComponent);
component = fixture.componentInstance;
createComponent();
}));
function createComponent() {
page = new Page();
component.user = new UserService().getBen();
fixture.detectChanges();
return fixture.whenStable().then(() => {
fixture.detectChanges();
page.addPageElements();
});
}
The component under test has an external template which is being loaded fine but it also has an external style sheet which isn't loading. Can this be done while configuring the test bed?