Skip to content
Snippets Groups Projects

fix: handle pdl starting with 0

Merged Bastien DUMONT requested to merge 23-handle-13-digits-pdl into main
All threads resolved!
11 files
+ 58
21
Compare changes
  • Side-by-side
  • Inline
Files
11
@@ -11,7 +11,9 @@ const {
parseValue,
removeMultipleSpaces,
removeAddressNumber,
parsePointId,
} = require('../../src/helpers/parsing')
describe('parsing', () => {
it('should parse userPdl', () => {
const result = {
@@ -222,4 +224,19 @@ describe('parsing', () => {
expect(reply).toBe('rue du lac')
})
})
describe('parsePointId', () => {
it('should test a regular point id', () => {
const point = parsePointId('12345678901234')
expect(point).toBe('12345678901234')
expect(point.length).toBe(14)
})
it('should test a point id starting with 0', () => {
const input = '7123456789012'
expect(input.length).toBe(13)
const point = parsePointId(input)
expect(point).toBe('07123456789012')
expect(point.length).toBe(14)
})
})
})
Loading