Skip to content

Commit

Permalink
Merge pull request #133 from ziemkowski/au-toll-free-formats
Browse files Browse the repository at this point in the history
Add additional AU formats
  • Loading branch information
ybrusentsov authored Nov 11, 2023
2 parents be00055 + 7e1425d commit 4ac6dd4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/data/countryData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export const defaultCountries: CountryData[] = [
default: '. .... ....',
'/^4/': '... ... ...',
'/^5(?!50)/': '... ... ...',
'/^1(3|8)00/': '.... ... ...',
'/^13/': '.. .. ..',
'/^180/': '... ....',
},
0,
[],
Expand Down
28 changes: 28 additions & 0 deletions src/utils/countryUtils/__tests__/getActiveFormattingMask.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,34 @@ describe('getActiveFormattingMask', () => {
}),
).toBe('. .... ....');

expect(
getActiveFormattingMask({
phone: '+61131234',
country: getCountryByIso2('au'),
}),
).toBe('.. .. ..');

expect(
getActiveFormattingMask({
phone: '+611300123456',
country: getCountryByIso2('au'),
}),
).toBe('.... ... ...');

expect(
getActiveFormattingMask({
phone: '+611801234',
country: getCountryByIso2('au'),
}),
).toBe('... ....');

expect(
getActiveFormattingMask({
phone: '+611800123456',
country: getCountryByIso2('au'),
}),
).toBe('.... ... ...');

// should return default mask if provided phone is empty
expect(
getActiveFormattingMask({
Expand Down

0 comments on commit 4ac6dd4

Please sign in to comment.