github.com/sl1pm4t/consul@v1.4.5-0.20190325224627-74c31c540f9c/ui-v2/tests/unit/utils/isFolder-test.js (about) 1 import { module } from 'ember-qunit'; 2 import test from 'ember-sinon-qunit/test-support/test'; 3 import isFolder from 'consul-ui/utils/isFolder'; 4 module('Unit | Utils | isFolder', {}); 5 6 test('it detects if a string ends in a slash', function(assert) { 7 [ 8 { 9 test: 'hello/world', 10 expected: false, 11 }, 12 { 13 test: 'hello/world/', 14 expected: true, 15 }, 16 { 17 test: '/hello/world', 18 expected: false, 19 }, 20 { 21 test: '//', 22 expected: true, 23 }, 24 { 25 test: undefined, 26 expected: false, 27 }, 28 ].forEach(function(item) { 29 const actual = isFolder(item.test); 30 assert.equal(actual, item.expected); 31 }); 32 });