@@ -290,54 +290,35 @@ export class TabViewTest extends testModule.UITest<tabViewModule.TabView> {
290290 }
291291
292292 public test_FontIsReappliedWhenTabItemsChange = function ( ) {
293- // let fontToString = (font: any): string => {
294- // if (this.testView.ios){
295- // return font.toString();
296- // }
297- // else {
298- // return `${font.typeface} ${font.size}`;
299- // }
300- // }
301-
302- let assertFontsAreEqual = ( actual : any , expected : any , message ?: string ) => {
293+ const assertFontsAreEqual = ( actual : any , expected : any , message ?: string ) => {
303294 if ( this . testView . ios ) {
304295 TKUnit . assertEqual ( actual , expected , message ) ;
305- }
306- else {
296+ } else {
307297 TKUnit . assertEqual ( actual . typeface , expected . typeface , `${ message } [typeface]` ) ;
308298 TKUnit . assertEqual ( actual . size , expected . size , `${ message } [size]` ) ;
309299 }
310300 }
311301
312- //console.log(`>>>>>>>>>>>>> CREATE 3 ITEMS`);
313302 this . testView . items = this . _createItems ( 1 ) ;
314303 this . waitUntilTestElementIsLoaded ( ) ;
315304
316- let originalFont = tabViewTestsNative . getNativeFont ( this . testView ) ;
317- //console.log(`>>>>>>>>>>>>> originalFont: ${fontToString(originalFont)}`);
318- let nativeFont : any ;
305+ const originalFont = tabViewTestsNative . getOriginalFont ( this . testView ) ;
306+ TKUnit . assertNotNull ( originalFont , "Original Font should be applied" ) ;
319307
320- //console.log(`>>>>>>>>>>>>> PACIFICO`);
321308 this . testView . style . font = "20 Pacifico" ;
322- nativeFont = tabViewTestsNative . getNativeFont ( this . testView ) ;
323- //console.log(`>>>>>>>>>>>>> nativeFont: ${fontToString(nativeFont)}`);
309+ let nativeFont = tabViewTestsNative . getNativeFont ( this . testView ) ;
310+ TKUnit . assertNotNull ( nativeFont , "Native Font should not be null" ) ;
311+ TKUnit . assertNotEqual ( originalFont , nativeFont , "Font should be changed" ) ;
324312
325- //console.log(`>>>>>>>>>>>>> CREATE 3 ITEMS`);
326313 this . testView . items = this . _createItems ( 2 ) ;
327314 assertFontsAreEqual ( tabViewTestsNative . getNativeFont ( this . testView ) , nativeFont , "Font must be 20 Pacifico after rebinding items." ) ;
328- //console.log(`>>>>>>>>>>>>> nativeFont: ${fontToString(nativeFont)}`);
329315
330- //console.log(`>>>>>>>>>>>>> MONOSPACE;`);
331316 this . testView . style . font = "bold 12 monospace" ;
332317 nativeFont = tabViewTestsNative . getNativeFont ( this . testView ) ;
333- //console.log(`>>>>>>>>>>>>> nativeFont: ${fontToString(nativeFont)}`);
334318
335- //console.log(`>>>>>>>>>>>>> CREATE 3 ITEMS`);
336319 this . testView . items = this . _createItems ( 3 ) ;
337320 assertFontsAreEqual ( tabViewTestsNative . getNativeFont ( this . testView ) , nativeFont , "Font must be bold 12 monospace after rebinding items." ) ;
338- //console.log(`>>>>>>>>>>>>> nativeFont: ${fontToString(nativeFont)}`);
339321
340- //console.log(`>>>>>>>>>>>>> RESET`);
341322 this . testView . style . font = unsetValue ;
342323 assertFontsAreEqual ( tabViewTestsNative . getNativeFont ( this . testView ) , originalFont , "Font must be the original one after resetting the style." ) ;
343324 }
0 commit comments