github.com/outbrain/consul@v1.4.5/ui-v2/tests/unit/utils/templatize-test.js (about)

     1  import templatize from 'consul-ui/utils/templatize';
     2  import { module, test } from 'qunit';
     3  
     4  module('Unit | Utility | templatize');
     5  
     6  test('it prefixes the word template to every string in the array', function(assert) {
     7    const expected = ['template-one', 'template-two'];
     8    const actual = templatize(['one', 'two']);
     9    assert.deepEqual(actual, expected);
    10  });
    11  test('it returns an empty array when passed an empty array', function(assert) {
    12    const expected = [];
    13    const actual = templatize([]);
    14    assert.deepEqual(actual, expected);
    15  });
    16  test('it returns an empty array when passed nothing', function(assert) {
    17    const expected = [];
    18    const actual = templatize();
    19    assert.deepEqual(actual, expected);
    20  });