Skip to content

Commit df55d9d

Browse files
committed
More tests
1 parent 6d92a2d commit df55d9d

2 files changed

Lines changed: 25 additions & 9 deletions

File tree

src/app/component/matrix/matrix.component.spec.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ describe('MatrixComponent', () => {
2121
beforeEach(() => {
2222
fixture = TestBed.createComponent(MatrixComponent);
2323
component = fixture.componentInstance;
24-
component.ngOnInit();
2524
fixture.detectChanges();
2625
});
2726

@@ -34,13 +33,5 @@ describe('MatrixComponent', () => {
3433
const HTMLElement: HTMLElement = fixture.nativeElement;
3534
const table = HTMLElement.querySelector('table')!;
3635
expect(table).toBeTruthy();
37-
//expect(p.textContent).toEqual('banner works!');
38-
});
39-
40-
it('check if all rows are being shown as chips', () => {
41-
var check = JSON.parse(JSON.stringify(component.MATRIX_DATA));
42-
console.log(check);
43-
expect(component.rowsCurrentlyBeingShown).toEqual(component.allRows);
44-
//expect(p.textContent).toEqual('banner works!');
4536
});
4637
});

src/app/component/sidenav-buttons/sidenav-buttons.component.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Component } from '@angular/core';
12
import { ComponentFixture, TestBed } from '@angular/core/testing';
23

34
import { SidenavButtonsComponent } from './sidenav-buttons.component';
@@ -21,4 +22,28 @@ describe('SidenavButtonsComponent', () => {
2122
it('should create', () => {
2223
expect(component).toBeTruthy();
2324
});
25+
26+
it('check for navigation list generation', () => {
27+
const HTMLElement: HTMLElement = fixture.nativeElement;
28+
const NavigationList = HTMLElement.querySelector('mat-nav-list')!;
29+
//console.log(NavigationList);
30+
expect(NavigationList).toBeTruthy();
31+
});
32+
33+
it('check for navigation names being shown in the same order as options array', () => {
34+
const HTMLElement: HTMLElement = fixture.nativeElement;
35+
const NavigationList = HTMLElement.querySelectorAll('h3')!;
36+
let NavigationNamesBeingShown = [];
37+
for (var x = 0; x < NavigationList.length; x += 1) {
38+
NavigationNamesBeingShown.push(NavigationList[x].textContent);
39+
}
40+
//console.log({ ...NavigationNamesBeingShown });
41+
//console.log(component.Options);
42+
expect(NavigationNamesBeingShown).toEqual(component.Options);
43+
});
44+
45+
it('ensure all navigation options has its own icon and route', () => {
46+
expect(component.Icons.length).toEqual(component.Options.length);
47+
expect(component.Routing.length).toEqual(component.Options.length);
48+
});
2449
});

0 commit comments

Comments
 (0)