Skip to content

Commit

Permalink
fix: fix test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Mar 30, 2020
1 parent 15d12a6 commit 4706624
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { MarkdownRenderComponent } from './markdown-render.component';
import { SharedModule } from '../../shared.module';
import { RouterTestingModule } from '@angular/router/testing';

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

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [SharedModule],
imports: [SharedModule, RouterTestingModule],
declarations: [ MarkdownRenderComponent ]
})
.compileComponents();
Expand Down
11 changes: 11 additions & 0 deletions src/app/shared/components/model/ledge-markdown-converter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,16 @@ config: {"type": "line-model"}
`;
const json = LedgeMarkdownConverter.toJson(code);
expect(json.lists.length).toEqual(1);
expect(json.lists[0].childrens.length).toEqual(3);
});

it('should build list with childrens', () => {
const code = `
- a
- b
`;
const json = LedgeMarkdownConverter.toJson(code);
expect(json.lists.length).toEqual(1);
expect(json.lists[0].childrens[0].childrens.length).toEqual(1);
});
});
4 changes: 4 additions & 0 deletions src/app/shared/toolset/toolset.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { ToolsetComponent } from './toolset.component';
import { CustomMaterialModule } from '../custom-material.module';

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

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [CustomMaterialModule],
declarations: [ ToolsetComponent ]
})
.compileComponents();
Expand All @@ -16,6 +18,8 @@ describe('ToolsetComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(ToolsetComponent);
component = fixture.componentInstance;
component.option = {id: '1', type: 'line-chart', data: []};

fixture.detectChanges();
});

Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/toolset/toolset.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class ToolsetComponent implements OnInit, AfterViewInit {
}

ngOnInit(): void {
console.log(this.option);
// console.log(this.option);
}

setToolsetStyle(option: ToolsetOption) {
Expand Down

0 comments on commit 4706624

Please sign in to comment.