@@ -314,7 +314,7 @@ describe('AppComponent', () => {
314314 it ( 'should not navigate when change to a version without a url' , ( ) => {
315315 setupSelectorForTesting ( ) ;
316316 const versionWithoutUrlIndex = component . docVersions . length ;
317- const versionWithoutUrl = component . docVersions [ versionWithoutUrlIndex ] = { title : 'foo' , url : null } ;
317+ const versionWithoutUrl = component . docVersions [ versionWithoutUrlIndex ] = { title : 'foo' } ;
318318 selectElement . triggerEventHandler ( 'change' , { option : versionWithoutUrl , index : versionWithoutUrlIndex } ) ;
319319 expect ( locationService . go ) . not . toHaveBeenCalled ( ) ;
320320 } ) ;
@@ -520,9 +520,9 @@ describe('AppComponent', () => {
520520
521521 describe ( 'aio-toc' , ( ) => {
522522 let tocDebugElement : DebugElement ;
523- let tocContainer : DebugElement ;
523+ let tocContainer : DebugElement | null ;
524524
525- const setHasFloatingToc = hasFloatingToc => {
525+ const setHasFloatingToc = ( hasFloatingToc : boolean ) => {
526526 component . hasFloatingToc = hasFloatingToc ;
527527 fixture . detectChanges ( ) ;
528528
@@ -551,12 +551,12 @@ describe('AppComponent', () => {
551551 } ) ;
552552
553553 it ( 'should update the TOC container\'s `maxHeight` based on `tocMaxHeight`' , ( ) => {
554- expect ( tocContainer . styles [ 'max-height' ] ) . toBeNull ( ) ;
554+ expect ( tocContainer ! . styles [ 'max-height' ] ) . toBeNull ( ) ;
555555
556556 component . tocMaxHeight = '100' ;
557557 fixture . detectChanges ( ) ;
558558
559- expect ( tocContainer . styles [ 'max-height' ] ) . toBe ( '100px' ) ;
559+ expect ( tocContainer ! . styles [ 'max-height' ] ) . toBe ( '100px' ) ;
560560 } ) ;
561561
562562 it ( 'should restrain scrolling inside the ToC container' , ( ) => {
@@ -565,7 +565,7 @@ describe('AppComponent', () => {
565565
566566 expect ( restrainScrolling ) . not . toHaveBeenCalled ( ) ;
567567
568- tocContainer . triggerEventHandler ( 'mousewheel' , evt ) ;
568+ tocContainer ! . triggerEventHandler ( 'mousewheel' , evt ) ;
569569 expect ( restrainScrolling ) . toHaveBeenCalledWith ( evt ) ;
570570 } ) ;
571571 } ) ;
@@ -591,7 +591,7 @@ describe('AppComponent', () => {
591591 initializeTest ( ) ;
592592 fixture . detectChanges ( ) ;
593593 const banner : HTMLElement = fixture . debugElement . query ( By . css ( 'aio-mode-banner' ) ) . nativeElement ;
594- expect ( banner . textContent . trim ( ) ) . toEqual ( '' ) ;
594+ expect ( banner . textContent ! . trim ( ) ) . toEqual ( '' ) ;
595595 } ) ;
596596 } ) ;
597597
@@ -985,9 +985,9 @@ describe('AppComponent', () => {
985985 checkHostClass ( 'mode' , 'archive' ) ;
986986 } ) ;
987987
988- function checkHostClass ( type , value ) {
988+ function checkHostClass ( type : string , value : string ) {
989989 const host = fixture . debugElement ;
990- const classes = host . properties [ 'className' ] ;
990+ const classes : string = host . properties [ 'className' ] ;
991991 const classArray = classes . split ( ' ' ) . filter ( c => c . indexOf ( `${ type } -` ) === 0 ) ;
992992 expect ( classArray . length ) . toBeLessThanOrEqual ( 1 , `"${ classes } " should have only one class matching ${ type } -*` ) ;
993993 expect ( classArray ) . toEqual ( [ `${ type } -${ value } ` ] , `"${ classes } " should contain ${ type } -${ value } ` ) ;
@@ -1212,10 +1212,10 @@ class TestHttpClient {
12121212 if ( / n a v i g a t i o n \. j s o n / . test ( url ) ) {
12131213 data = this . navJson ;
12141214 } else {
1215- const match = / g e n e r a t e d \/ d o c s \/ ( .+ ) \. j s o n / . exec ( url ) ;
1216- const id = match [ 1 ] ;
1215+ const match = / g e n e r a t e d \/ d o c s \/ ( .+ ) \. j s o n / . exec ( url ) ! ;
1216+ const id = match [ 1 ] ! ;
12171217 // Make up a title for test purposes
1218- const title = id . split ( '/' ) . pop ( ) . replace ( / ^ ( [ a - z ] ) / , ( _ , letter ) => letter . toUpperCase ( ) ) ;
1218+ const title = id . split ( '/' ) . pop ( ) ! . replace ( / ^ ( [ a - z ] ) / , ( _ , letter ) => letter . toUpperCase ( ) ) ;
12191219 const h1 = ( id === 'no-title' ) ? '' : `<h1>${ title } </h1>` ;
12201220 const contents = `${ h1 } <h2 id="#somewhere">Some heading</h2>` ;
12211221 data = { id, contents } ;
0 commit comments