9
9
import localeCaESVALENCIA from '@angular/common/locales/ca-ES-VALENCIA' ;
10
10
import localeEn from '@angular/common/locales/en' ;
11
11
import localeFr from '@angular/common/locales/fr' ;
12
+ import localeZh from '@angular/common/locales/zh' ;
12
13
import localeFrCA from '@angular/common/locales/fr-CA' ;
13
14
import { registerLocaleData } from '../../src/i18n/locale_data' ;
14
- import { findLocaleData , getCurrencySymbol } from '../../src/i18n/locale_data_api' ;
15
+ import { findLocaleData , getCurrencySymbol , getLocaleDateFormat , FormatWidth } from '../../src/i18n/locale_data_api' ;
15
16
16
17
{
17
18
describe ( 'locale data api' , ( ) => {
@@ -22,6 +23,7 @@ import {findLocaleData, getCurrencySymbol} from '../../src/i18n/locale_data_api'
22
23
registerLocaleData ( localeFrCA ) ;
23
24
registerLocaleData ( localeFr , 'fake-id' ) ;
24
25
registerLocaleData ( localeFrCA , 'fake_Id2' ) ;
26
+ registerLocaleData ( localeZh ) ;
25
27
} ) ;
26
28
27
29
describe ( 'findLocaleData' , ( ) => {
@@ -64,5 +66,10 @@ import {findLocaleData, getCurrencySymbol} from '../../src/i18n/locale_data_api'
64
66
expect ( getCurrencySymbol ( 'FAKE' , 'narrow' ) ) . toEqual ( 'FAKE' ) ;
65
67
} ) ;
66
68
} ) ;
69
+
70
+ describe ( 'getLastDefinedValue' , ( ) => {
71
+ it ( 'should find the last defined date format when format not defined' ,
72
+ ( ) => { expect ( getLocaleDateFormat ( 'zh' , FormatWidth . Long ) ) . toEqual ( 'y年M月d日' ) ; } ) ;
73
+ } ) ;
67
74
} ) ;
68
75
}
0 commit comments