File size: 774 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import { normalizePagePath } from './normalize-page-path'
describe('normalizePagePath', () => {
it('should normalize the page path', () => {
expect(normalizePagePath('/')).toBe('/index')
})
it('should normalize the page path with a dynamic route', () => {
expect(normalizePagePath('/[locale]')).toBe('/[locale]')
})
it('should normalize the page path with a dynamic route and a trailing slash', () => {
expect(normalizePagePath('/[locale]/')).toBe('/[locale]/')
})
it('should normalize the page with a leading index', () => {
expect(normalizePagePath('/index')).toBe('/index/index')
})
it('should normalize the page with a leading index and suffix', () => {
expect(normalizePagePath('/index/foo')).toBe('/index/index/foo')
})
})
|