@@ -564,6 +564,17 @@ describe('CountriesCachedModel', () => {
564564 } ) ;
565565
566566 describe ( 'dropdownList' , ( ) => {
567+ it ( 'turns a list of countries into sorted drop down select box options' , ( ) => {
568+ const items = instance . dropdownList ( countries , false , false ) ;
569+
570+ items . should . deep . equal ( [
571+ { value : 'BA' , text : 'Bar' , label : 'Bar' } ,
572+ { value : 'AA' , text : 'Foo' , label : 'Foo' } ,
573+ { value : 'NA' , text : 'Narnia' , label : 'Narnia' } ,
574+ { value : 'GB' , text : 'United Kingdom' , label : 'United Kingdom' } ,
575+ ] ) ;
576+ } ) ;
577+
567578 it ( 'turns a list of countries into sorted drop down select box options with GB at the top' , ( ) => {
568579 const items = instance . dropdownList ( countries , false ) ;
569580
@@ -594,6 +605,12 @@ describe('CountriesCachedModel', () => {
594605 items . should . deep . equal ( [ unitedKingdom , bar , foo , narnia ] ) ;
595606 } ) ;
596607
608+ it ( 'turns a list of countries into sorted list with GB at the top by default when flag not provided' , ( ) => {
609+ const items = instance . sortCountryList ( countries ) ;
610+
611+ items . should . deep . equal ( [ unitedKingdom , bar , foo , narnia ] ) ;
612+ } ) ;
613+
597614 it ( 'turns a list of countries into sorted list' , ( ) => {
598615 const items = instance . sortCountryList ( countries , false ) ;
599616
0 commit comments