@@ -29,6 +29,7 @@ describe('load', () => {
2929} ) ;
3030
3131describe ( 'load numbers' , ( ) => {
32+
3233 it ( 'should set symbols' , ( ) => {
3334 const symbols = cldr . bg . numbers . symbols ;
3435 expect ( symbols . decimal ) . toEqual ( "," ) ;
@@ -43,34 +44,45 @@ describe('load numbers', () => {
4344 } ) ;
4445
4546 it ( 'should set currency pattern' , ( ) => {
46- const currency = cldr . bg . numbers . currency ;
47- expect ( currency . patterns [ 0 ] ) . toEqual ( "n $" ) ;
48- expect ( currency . groupSize . length ) . toEqual ( 1 ) ;
49- expect ( currency . groupSize [ 0 ] ) . toEqual ( 3 ) ;
50- } ) ;
51-
52- it ( 'should set currency unit patterns' , ( ) => {
53- const currency = cldr . bg . numbers . currency ;
54- expect ( currency [ "unitPattern-count-one" ] ) . toEqual ( "n $" ) ;
55- expect ( currency [ "unitPattern-count-other" ] ) . toEqual ( "n $" ) ;
56- } ) ;
57-
58- it ( 'should set percent pattern' , ( ) => {
59- const percent = cldr . bg . numbers . percent ;
60- expect ( percent . patterns [ 0 ] ) . toEqual ( "n%" ) ;
61- expect ( percent . groupSize . length ) . toEqual ( 1 ) ;
62- expect ( percent . groupSize [ 0 ] ) . toEqual ( 3 ) ;
63- } ) ;
64-
65- it ( 'should set currencies' , ( ) => {
66- const currencies = cldr . bg . numbers . currencies ;
67- expect ( currencies ) . toBeDefined ( ) ;
68- } ) ;
69-
70- it ( 'should set localeCurrency' , ( ) => {
71- const localeCurrency = cldr . bg . numbers . localeCurrency ;
72- expect ( localeCurrency ) . toEqual ( "BGN" ) ;
73- } ) ;
47+ const currency = cldr . bg . numbers . currency ;
48+ expect ( currency . patterns [ 0 ] ) . toEqual ( "n $" ) ;
49+ expect ( currency . groupSize . length ) . toEqual ( 1 ) ;
50+ expect ( currency . groupSize [ 0 ] ) . toEqual ( 3 ) ;
51+ } ) ;
52+
53+ it ( 'should set currency unit patterns' , ( ) => {
54+ const currency = cldr . bg . numbers . currency ;
55+ expect ( currency [ "unitPattern-count-one" ] ) . toEqual ( "n $" ) ;
56+ expect ( currency [ "unitPattern-count-other" ] ) . toEqual ( "n $" ) ;
57+ } ) ;
58+
59+ it ( 'should set percent pattern' , ( ) => {
60+ const percent = cldr . bg . numbers . percent ;
61+ expect ( percent . patterns [ 0 ] ) . toEqual ( "n%" ) ;
62+ expect ( percent . groupSize . length ) . toEqual ( 1 ) ;
63+ expect ( percent . groupSize [ 0 ] ) . toEqual ( 3 ) ;
64+ } ) ;
65+
66+ describe ( 'load currencies' , ( ) => {
67+
68+ it ( 'should set currencies' , ( ) => {
69+ const currencies = cldr . bg . numbers . currencies ;
70+ expect ( currencies ) . toBeDefined ( ) ;
71+ } ) ;
72+
73+ it ( 'should not throw error if territory currency is missing in currencyData' , ( ) => {
74+ expect ( ( ) => {
75+ const bgCurrencies = cldr . supplemental . currencyData . region . BG ;
76+ try {
77+ delete cldr . supplemental . currencyData . region . BG ;
78+ load ( currencies ) ;
79+ } finally {
80+ cldr . supplemental . currencyData . region . BG = bgCurrencies ;
81+ }
82+ } ) . not . toThrow ( ) ;
83+ } ) ;
84+ } ) ;
85+
7486} ) ;
7587
7688describe ( 'load calendar' , ( ) => {
@@ -183,8 +195,8 @@ describe('load calendar', () => {
183195
184196 expect ( dateFields . wide ) . toBeDefined ( ) ;
185197 expect ( dateFields . wide ) . toEqual ( 'ера' ) ;
186- expect ( dateFields . short ) . not . toBeDefined ( ) ;
187- expect ( dateFields . narrow ) . not . toBeDefined ( ) ;
198+ expect ( dateFields . short ) . toEqual ( 'ера' ) ;
199+ expect ( dateFields . narrow ) . toEqual ( 'ера' ) ;
188200 } ) ;
189201
190202 it ( 'should set year display name' , ( ) => {
@@ -231,16 +243,16 @@ describe('load calendar', () => {
231243 const dateFields = cldr . bg . calendar . dateFields . weekday ;
232244
233245 expect ( dateFields . wide ) . toBeDefined ( ) ;
234- expect ( dateFields . short ) . not . toBeDefined ( ) ;
235- expect ( dateFields . narrow ) . not . toBeDefined ( ) ;
246+ expect ( dateFields . short ) . toBeDefined ( ) ;
247+ expect ( dateFields . narrow ) . toBeDefined ( ) ;
236248 } ) ;
237249
238250 it ( 'should set dayperiod display name' , ( ) => {
239251 const dateFields = cldr . bg . calendar . dateFields . dayperiod ;
240252
241253 expect ( dateFields . wide ) . toBeDefined ( ) ;
242- expect ( dateFields . short ) . not . toBeDefined ( ) ;
243- expect ( dateFields . narrow ) . not . toBeDefined ( ) ;
254+ expect ( dateFields . short ) . toBeDefined ( ) ;
255+ expect ( dateFields . narrow ) . toBeDefined ( ) ;
244256 } ) ;
245257
246258 it ( 'should set hour display name' , ( ) => {
@@ -271,8 +283,8 @@ describe('load calendar', () => {
271283 const dateFields = cldr . bg . calendar . dateFields . zone ;
272284
273285 expect ( dateFields . wide ) . toBeDefined ( ) ;
274- expect ( dateFields . short ) . not . toBeDefined ( ) ;
275- expect ( dateFields . narrow ) . not . toBeDefined ( ) ;
286+ expect ( dateFields . short ) . toBeDefined ( ) ;
287+ expect ( dateFields . narrow ) . toBeDefined ( ) ;
276288 } ) ;
277289} ) ;
278290
0 commit comments