You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui-v2/tests/unit/utils/routing/wildcard-test.js

26 lines
652 B

import wildcard from 'consul-ui/utils/routing/wildcard';
import { module, test } from 'qunit';
module('Unit | Utility | routing/wildcard', function() {
test('it finds a * in a path', function(assert) {
const isWildcard = wildcard({
route: {
_options: {
path: 'i-m-a-wildcard*',
},
},
});
assert.ok(isWildcard('route'));
});
test("it returns false without throwing if it doesn't find route", function(assert) {
const isWildcard = wildcard({
route: {
_options: {
path: 'i-m-a-wildcard*',
},
},
});
assert.notOk(isWildcard('not-route'));
});
});