Commit 70591c28 authored by Alexander Philipp Nowosad's avatar Alexander Philipp Nowosad
Browse files

Fix tests

parent 248fd8d6
Pipeline #122236 passed with stages
in 14 minutes and 56 seconds
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
import { createComponentFactory, Spectator } from '@ngneat/spectator';
import { RouterTestingModule } from '@angular/router/testing';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
let spectator: Spectator<AppComponent>;
const createComponent = createComponentFactory({
component: AppComponent,
imports: [RouterTestingModule],
});
it(`should have as title 'bmdl-modeler'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('bmdl-modeler');
});
beforeEach(() => spectator = createComponent());
it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to bmdl-modeler!');
it('should create the app', () => {
expect(spectator.debugElement.componentInstance).toBeTruthy();
});
});
import { BusinessModelViewComponent } from './business-model-view.component';
import { createRoutingFactory, Spectator } from '@ngneat/spectator';
import { createComponentFactory, Spectator } from '@ngneat/spectator';
import { ReactiveFormsModule } from '@angular/forms';
import { MockComponent } from 'ng-mocks';
import { CanvasBuildingBlockComponent } from '../canvas-building-block/canvas-building-block.component';
import { RouterTestingModule } from '@angular/router/testing';
describe('BusinessModelViewComponent', () => {
let spectator: Spectator<BusinessModelViewComponent>;
const createComponent = createRoutingFactory({
const createComponent = createComponentFactory({
component: BusinessModelViewComponent,
declarations: [
MockComponent(CanvasBuildingBlockComponent),
],
imports: [ReactiveFormsModule],
stubsEnabled: false,
imports: [ReactiveFormsModule, RouterTestingModule],
});
beforeEach(() => spectator = createComponent());
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CanvasBuildingBlockComponent } from './canvas-building-block.component';
import { createComponentFactory, Spectator } from '@ngneat/spectator';
describe('CanvasBuildingBlockComponent', () => {
let component: CanvasBuildingBlockComponent;
let fixture: ComponentFixture<CanvasBuildingBlockComponent>;
let spectator: Spectator<CanvasBuildingBlockComponent>;
const createComponent = createComponentFactory(CanvasBuildingBlockComponent);
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CanvasBuildingBlockComponent ]
})
.compileComponents();
}));
const feature = {
id: 1,
name: 'Value Propositions',
isMandatory: true,
hasOrSubfeatures: false,
hasXOrSubfeatures: true,
isDeletable: false,
requiringDependencyFrom: [],
requiringDependencyTo: [],
excludingDependency: [],
features: [
{
id: 10,
name: 'Save Privacy',
isMandatory: false,
hasOrSubfeatures: false,
hasXOrSubfeatures: false,
isDeletable: true,
requiringDependencyFrom: [
14
],
requiringDependencyTo: [],
excludingDependency: [
24,
11
],
features: [],
businessModelIds: [
1
],
parentId: 1
},
{
id: 11,
name: 'Free For All',
isMandatory: false,
hasOrSubfeatures: false,
hasXOrSubfeatures: false,
isDeletable: true,
requiringDependencyFrom: [],
requiringDependencyTo: [
24
],
excludingDependency: [
10
],
features: [],
businessModelIds: [],
parentId: 1
},
{
id: 12,
name: 'Collaborate With Others',
isMandatory: false,
hasOrSubfeatures: false,
hasXOrSubfeatures: false,
isDeletable: true,
requiringDependencyFrom: [],
requiringDependencyTo: [
26
],
excludingDependency: [],
features: [],
businessModelIds: [
1
],
parentId: 1
}
],
businessModelIds: [
1
],
parentId: 0
};
beforeEach(() => {
fixture = TestBed.createComponent(CanvasBuildingBlockComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
beforeEach(() => spectator = createComponent({
props: {
feature,
}
}));
it('should create', () => {
expect(component).toBeTruthy();
expect(spectator.component).toBeTruthy();
});
});
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FeatureModelDetailComponent } from './feature-model-detail.component';
import { createComponentFactory, Spectator } from '@ngneat/spectator';
import { ReactiveFormsModule } from '@angular/forms';
import { MockComponent } from 'ng-mocks';
import { FeatureTreeComponent } from '../feature-tree/feature-tree.component';
import { RouterTestingModule } from '@angular/router/testing';
describe('FeatureModelDetailComponent', () => {
let component: FeatureModelDetailComponent;
let fixture: ComponentFixture<FeatureModelDetailComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FeatureModelDetailComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FeatureModelDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
let spectator: Spectator<FeatureModelDetailComponent>;
const createComponent = createComponentFactory({
component: FeatureModelDetailComponent,
declarations: [MockComponent(FeatureTreeComponent)],
imports: [ReactiveFormsModule, RouterTestingModule],
});
beforeEach(() => spectator = createComponent());
it('should create', () => {
expect(component).toBeTruthy();
expect(spectator.component).toBeTruthy();
});
});
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FeatureModelViewComponent } from './feature-model-view.component';
import { ReactiveFormsModule } from '@angular/forms';
import { createRoutingFactory, Spectator } from '@ngneat/spectator';
import { MockComponent } from 'ng-mocks';
import { FeatureBuildingBlockComponent } from '../feature-building-block/feature-building-block.component';
describe('FeatureModelViewComponent', () => {
let component: FeatureModelViewComponent;
let fixture: ComponentFixture<FeatureModelViewComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FeatureModelViewComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FeatureModelViewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
let spectator: Spectator<FeatureModelViewComponent>;
const createComponent = createRoutingFactory({
component: FeatureModelViewComponent,
declarations: [MockComponent(FeatureBuildingBlockComponent)],
imports: [ReactiveFormsModule],
});
beforeEach(() => spectator = createComponent());
it('should create', () => {
expect(component).toBeTruthy();
expect(spectator.component).toBeTruthy();
});
});
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FeatureModelComponent } from './feature-model.component';
import { createRoutingFactory, Spectator } from '@ngneat/spectator';
import { ReactiveFormsModule } from '@angular/forms';
describe('FeatureModelComponent', () => {
let component: FeatureModelComponent;
let fixture: ComponentFixture<FeatureModelComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FeatureModelComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FeatureModelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
let spectator: Spectator<FeatureModelComponent>;
const createComponent = createRoutingFactory({
component: FeatureModelComponent,
imports: [ReactiveFormsModule],
});
beforeEach(() => spectator = createComponent());
it('should create', () => {
expect(component).toBeTruthy();
expect(spectator.component).toBeTruthy();
});
});
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ToolExplanationComponent } from './tool-explanation.component';
import { createComponentFactory, Spectator } from '@ngneat/spectator';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
describe('ToolExplanationComponent', () => {
let component: ToolExplanationComponent;
let fixture: ComponentFixture<ToolExplanationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ToolExplanationComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ToolExplanationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
let spectator: Spectator<ToolExplanationComponent>;
const createComponent = createComponentFactory({
component: ToolExplanationComponent,
imports: [NgbModule],
});
beforeEach(() => spectator = createComponent());
it('should create', () => {
expect(component).toBeTruthy();
expect(spectator.component).toBeTruthy();
});
});
Markdown is supported
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