11import { describe , expect , test } from 'vitest' ;
2- import { formatOrganizationNumber as formatOrganizationNumberNo } from './no' ;
3- import { formatOrganizationNumber as formatOrganizationNumberSe } from './se' ;
2+ import {
3+ formatOrganizationNumber as formatOrganizationNumberNo ,
4+ formatPhoneNumber as formatPhoneNumberNo ,
5+ } from './no' ;
6+ import {
7+ formatOrganizationNumber as formatOrganizationNumberSe ,
8+ formatPhoneNumber as formatPhoneNumberSe ,
9+ } from './se' ;
410
511describe ( 'no' , ( ) => {
12+ test . each ( [
13+ [ '22865500' , '22 86 55 00' ] ,
14+ [ '80000000' , '800 00 000' ] ,
15+ ] ) ( 'formatPhoneNumber(%s) -> %s' , ( input , expected ) => {
16+ expect ( formatPhoneNumberNo ( input ) ) . toBe ( expected ) ;
17+ } ) ;
18+
619 test . each ( [
720 [ '000000000' , '000 000 000' ] ,
821 [ '000 000 000' , '000 000 000' ] ,
@@ -14,6 +27,13 @@ describe('no', () => {
1427} ) ;
1528
1629describe ( 'se' , ( ) => {
30+ test . each ( [
31+ [ '0701234567' , '070-123 45 67' ] ,
32+ [ '0801234567' , '070-123 45 67' ] ,
33+ ] ) ( 'formatPhoneNumber(%s) -> %s' , ( input , expected ) => {
34+ expect ( formatPhoneNumberSe ( input ) ) . toBe ( expected ) ;
35+ } ) ;
36+
1737 test . each ( [
1838 [ '0000000000' , '000000-0000' ] ,
1939 [ '000000-0000' , '000000-0000' ] ,
0 commit comments