- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
21 lines
757 B
JavaScript
21 lines
757 B
JavaScript
import extractCountryCallingCode from './extractCountryCallingCode.js'
|
|
import metadata from '../../metadata.min.json' with { type: 'json' }
|
|
|
|
describe('extractCountryCallingCode', () => {
|
|
it('should extract country calling code from a number', () => {
|
|
expect(extractCountryCallingCode('+78005553535', null, null, null, metadata)).to.deep.equal({
|
|
countryCallingCodeSource: 'FROM_NUMBER_WITH_PLUS_SIGN',
|
|
countryCallingCode: '7',
|
|
number: '8005553535'
|
|
})
|
|
|
|
expect(extractCountryCallingCode('+7800', null, null, null, metadata)).to.deep.equal({
|
|
countryCallingCodeSource: 'FROM_NUMBER_WITH_PLUS_SIGN',
|
|
countryCallingCode: '7',
|
|
number: '800'
|
|
})
|
|
|
|
expect(extractCountryCallingCode('', null, null, null, metadata)).to.deep.equal({})
|
|
})
|
|
})
|