File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,23 @@ describe("Verifying the functionality of hooks", () => {
124
124
expect ( ( result . current . metadata as any ) [ 0 ] ) . toBe ( "am" ) ;
125
125
} )
126
126
127
+ it ( "Check usePhone for advanced country filtering" , ( ) => {
128
+ const { result} = renderHook ( usePhoneTester , {
129
+ initialProps : {
130
+ onlyCountries : [ "ae" , "gb" , "us" ] as any ,
131
+ excludeCountries : [ "1907" , "1205" , "1251" ] as any ,
132
+ }
133
+ } ) ;
134
+
135
+ expect ( result . current . countriesList . map ( c => c [ 2 ] ) . includes ( "1" ) ) ;
136
+ expect ( result . current . countriesList . map ( c => c [ 2 ] ) . includes ( "44" ) ) ;
137
+ expect ( result . current . countriesList . map ( c => c [ 2 ] ) . includes ( "971" ) ) ;
138
+
139
+ expect ( ! result . current . countriesList . map ( c => c [ 2 ] ) . includes ( "1907" ) ) ;
140
+ expect ( ! result . current . countriesList . map ( c => c [ 2 ] ) . includes ( "1205" ) ) ;
141
+ expect ( ! result . current . countriesList . map ( c => c [ 2 ] ) . includes ( "1251" ) ) ;
142
+ } )
143
+
127
144
it ( "Check usePhone without parentheses" , ( ) => {
128
145
const { result} = renderHook ( usePhoneTester , {
129
146
initialProps : {
You can’t perform that action at this time.
0 commit comments