Files
shields/frontend/components/customizer/path-builder.spec.js
Paul Melnikow 4bd16f93e8 Sort imports and requires (#3056)
This will definitely save time, and ensure more uniformity.

It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.

Closes #2701
2019-02-21 22:14:40 -05:00

29 lines
683 B
JavaScript

import { test, given } from 'sazerac'
import pathToRegexp from 'path-to-regexp'
import PathBuilder from './path-builder'
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,
})
})
})