Stone, Avi (as206k) | 548c5a2 | 2018-06-03 13:12:12 +0300 | [diff] [blame^] | 1 | import { ComponentFixture, TestBed, async } from '@angular/core/testing'; |
Stone, Avi (as206k) | 9b2ceb3 | 2018-04-12 16:36:39 +0300 | [diff] [blame] | 2 | import { DiagramComponent } from './diagram.component'; |
| 3 | |
| 4 | describe('DiagramComponent', () => { |
| 5 | let component: DiagramComponent; |
| 6 | let fixture: ComponentFixture<DiagramComponent>; |
| 7 | |
| 8 | beforeEach( |
| 9 | async(() => { |
| 10 | TestBed.configureTestingModule({ |
| 11 | declarations: [DiagramComponent] |
| 12 | }).compileComponents(); |
| 13 | }) |
| 14 | ); |
| 15 | |
| 16 | beforeEach(() => { |
| 17 | fixture = TestBed.createComponent(DiagramComponent); |
| 18 | component = fixture.componentInstance; |
| 19 | fixture.detectChanges(); |
| 20 | }); |
| 21 | |
| 22 | it('should create', () => { |
| 23 | expect(component).toBeTruthy(); |
| 24 | }); |
Stone, Avi (as206k) | 548c5a2 | 2018-06-03 13:12:12 +0300 | [diff] [blame^] | 25 | |
| 26 | it('should check on change check maxLengthLeft', () => { |
| 27 | component.list = [ |
| 28 | { |
| 29 | name1: 'node1dsvsdsvd', |
| 30 | name2: 'node2', |
| 31 | p1: 'Stream_publish_0', |
| 32 | p2: 'capability' |
| 33 | }, |
| 34 | { |
| 35 | name1: 'node33', |
| 36 | name2: 'node2555', |
| 37 | p1: 'requirement2', |
| 38 | p2: 'capability11' |
| 39 | }, |
| 40 | { |
| 41 | name1: 'namber4', |
| 42 | name2: 'namber3', |
| 43 | p1: 'requirement3', |
| 44 | p2: 'capability4' |
| 45 | } |
| 46 | ]; |
| 47 | component.ngOnChanges(); |
| 48 | expect(component.maxLengthLeft).toBe(16); |
| 49 | }); |
| 50 | it('should check on change check maxLengthRight', () => { |
| 51 | component.list = [ |
| 52 | { |
| 53 | name1: 'node1dsvsdsvd', |
| 54 | name2: 'node2', |
| 55 | p1: 'Stream_publish_0', |
| 56 | p2: 'capability' |
| 57 | }, |
| 58 | { |
| 59 | name1: 'node33', |
| 60 | name2: 'node2555', |
| 61 | p1: 'requirement2', |
| 62 | p2: 'capability11' |
| 63 | }, |
| 64 | { |
| 65 | name1: 'namber4', |
| 66 | name2: 'namber3', |
| 67 | p1: 'requirement3', |
| 68 | p2: 'capability4' |
| 69 | } |
| 70 | ]; |
| 71 | component.ngOnChanges(); |
| 72 | expect(component.maxLengthRight).toBe(12); |
| 73 | }); |
| 74 | it('should check on change check maxWidth', () => { |
| 75 | component.list = [ |
| 76 | { |
| 77 | name1: 'node1dsvsdsvd', |
| 78 | name2: 'node2', |
| 79 | p1: 'Stream_publish_0', |
| 80 | p2: 'capability' |
| 81 | }, |
| 82 | { |
| 83 | name1: 'node33', |
| 84 | name2: 'node2555', |
| 85 | p1: 'requirement2', |
| 86 | p2: 'capability11' |
| 87 | }, |
| 88 | { |
| 89 | name1: 'namber4', |
| 90 | name2: 'namber3', |
| 91 | p1: 'requirement3', |
| 92 | p2: 'capability4' |
| 93 | } |
| 94 | ]; |
| 95 | component.ngOnChanges(); |
| 96 | expect(component.maxWidth).toBe(550); |
| 97 | }); |
Stone, Avi (as206k) | 9b2ceb3 | 2018-04-12 16:36:39 +0300 | [diff] [blame] | 98 | }); |