Files
shields/frontend/components/customizer/path-builder.spec.js
Paul Melnikow 90f8ad5b73 Endpoint customizer (#2908)
* Endpoint page: improve formatting

Cherry-picked from #2906 (conflicts with that)

Partly addresses #2837 but does not resolve it

* Add badge customizer to the endpoint page

* Clean lint
2019-02-14 19:08:56 -06:00

29 lines
683 B
JavaScript

import PathBuilder from './path-builder'
import { test, given } from 'sazerac'
import pathToRegexp from 'path-to-regexp'
describe('<PathBuilder />', function() {
const tokens = pathToRegexp.parse('github/license/:user/:repo')
test(PathBuilder.constructPath, () => {
given({
tokens,
namedParams: {
user: 'paulmelnikow',
repo: 'react-boxplot',
},
}).expect({
path: 'github/license/paulmelnikow/react-boxplot',
isComplete: true,
})
given({
tokens,
namedParams: {
user: 'paulmelnikow',
},
}).expect({
path: 'github/license/paulmelnikow/:repo',
isComplete: false,
})
})
})