1+ import { Component } from '@angular/core' ;
12import { ComponentFixture , TestBed } from '@angular/core/testing' ;
23
34import { 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