open-consul/ui-v2/tests/unit/utils/templatize-test.js
John Cowen 52a62f2b8d UI: New ACLs (#4789)
UI to accompany the new ACLs APIs
2018-10-19 08:45:05 -07:00

21 lines
705 B
JavaScript

import templatize from 'consul-ui/utils/templatize';
import { module, test } from 'qunit';
module('Unit | Utility | templatize');
test('it prefixes the word template to every string in the array', function(assert) {
const expected = ['template-one', 'template-two'];
const actual = templatize(['one', 'two']);
assert.deepEqual(actual, expected);
});
test('it returns an empty array when passed an empty array', function(assert) {
const expected = [];
const actual = templatize([]);
assert.deepEqual(actual, expected);
});
test('it returns an empty array when passed nothing', function(assert) {
const expected = [];
const actual = templatize();
assert.deepEqual(actual, expected);
});