@@ -18,11 +18,6 @@ const JAN = 1, FEB = 2, MAR = 3, DEC = 12;
1818describe ( 'LuxonDateAdapter' , ( ) => {
1919 let adapter : DateAdapter < DateTime > ;
2020
21- if ( ! isSupported ( ) ) {
22- it ( 'should pass' , ( ) => expect ( 1 ) . toBe ( 1 ) ) ;
23- return ;
24- }
25-
2621 beforeEach ( waitForAsync ( ( ) => {
2722 TestBed . configureTestingModule ( {
2823 imports : [ LuxonDateModule ]
@@ -205,11 +200,11 @@ describe('LuxonDateAdapter', () => {
205200 it ( 'should format with a different locale' , ( ) => {
206201 let date = adapter . format ( DateTime . local ( 2017 , JAN , 2 ) , 'DD' ) ;
207202
208- expect ( stripDirectionalityCharacters ( date ) ) . toEqual ( 'Jan 2, 2017' ) ;
203+ expect ( date ) . toEqual ( 'Jan 2, 2017' ) ;
209204 adapter . setLocale ( 'da-DK' ) ;
210205
211206 date = adapter . format ( DateTime . local ( 2017 , JAN , 2 ) , 'DD' ) ;
212- expect ( stripDirectionalityCharacters ( date ) ) . toEqual ( '2. jan. 2017' ) ;
207+ expect ( date ) . toEqual ( '2. jan. 2017' ) ;
213208 } ) ;
214209
215210 it ( 'should throw when attempting to format invalid date' , ( ) => {
@@ -377,11 +372,6 @@ describe('LuxonDateAdapter', () => {
377372describe ( 'LuxonDateAdapter with MAT_DATE_LOCALE override' , ( ) => {
378373 let adapter : DateAdapter < DateTime > ;
379374
380- if ( ! isSupported ( ) ) {
381- it ( 'should pass' , ( ) => expect ( 1 ) . toBe ( 1 ) ) ;
382- return ;
383- }
384-
385375 beforeEach ( waitForAsync ( ( ) => {
386376 TestBed . configureTestingModule ( {
387377 imports : [ LuxonDateModule ] ,
@@ -393,18 +383,13 @@ describe('LuxonDateAdapter with MAT_DATE_LOCALE override', () => {
393383
394384 it ( 'should take the default locale id from the MAT_DATE_LOCALE injection token' , ( ) => {
395385 const date = adapter . format ( DateTime . local ( 2017 , JAN , 2 ) , 'DD' ) ;
396- expect ( stripDirectionalityCharacters ( date ) ) . toEqual ( '2. jan. 2017' ) ;
386+ expect ( date ) . toEqual ( '2. jan. 2017' ) ;
397387 } ) ;
398388} ) ;
399389
400390describe ( 'LuxonDateAdapter with LOCALE_ID override' , ( ) => {
401391 let adapter : DateAdapter < DateTime > ;
402392
403- if ( ! isSupported ( ) ) {
404- it ( 'should pass' , ( ) => expect ( 1 ) . toBe ( 1 ) ) ;
405- return ;
406- }
407-
408393 beforeEach ( waitForAsync ( ( ) => {
409394 TestBed . configureTestingModule ( {
410395 imports : [ LuxonDateModule ] ,
@@ -416,20 +401,13 @@ describe('LuxonDateAdapter with LOCALE_ID override', () => {
416401
417402 it ( 'should take the default locale id from the LOCALE_ID injection token' , ( ) => {
418403 const date = adapter . format ( DateTime . local ( 2017 , JAN , 2 ) , 'DD' ) ;
419-
420- // Some browsers add extra invisible characters that we should strip before asserting.
421- expect ( stripDirectionalityCharacters ( date ) ) . toEqual ( '2 janv. 2017' ) ;
404+ expect ( date ) . toEqual ( '2 janv. 2017' ) ;
422405 } ) ;
423406} ) ;
424407
425408describe ( 'LuxonDateAdapter with MAT_LUXON_DATE_ADAPTER_OPTIONS override' , ( ) => {
426409 let adapter : DateAdapter < DateTime > ;
427410
428- if ( ! isSupported ( ) ) {
429- it ( 'should pass' , ( ) => expect ( 1 ) . toBe ( 1 ) ) ;
430- return ;
431- }
432-
433411 beforeEach ( waitForAsync ( ( ) => {
434412 TestBed . configureTestingModule ( {
435413 imports : [ LuxonDateModule ] ,
@@ -467,16 +445,6 @@ describe('LuxonDateAdapter with MAT_LUXON_DATE_ADAPTER_OPTIONS override', () =>
467445
468446} ) ;
469447
470-
471- function isSupported ( ) : boolean {
472- // As of version 2.0.0 Luxon doesn't support any version of IE so we have to skip the tests there.
473- return typeof navigator !== 'undefined' && ! ( / ( m s i e | t r i d e n t | e d g e ) / i. test ( navigator . userAgent ) ) ;
474- }
475-
476- function stripDirectionalityCharacters ( str : string ) {
477- return str . replace ( / [ \u200e \u200f ] / g, '' ) ;
478- }
479-
480448function assertValidDate ( adapter : DateAdapter < DateTime > , d : DateTime | null , valid : boolean ) {
481449 expect ( adapter . isDateInstance ( d ) ) . not
482450 . withContext ( `Expected ${ d } to be a date instance` ) . toBeNull ( ) ;
0 commit comments