consul/ui/packages/consul-ui/tests/unit/utils/left-trim-test.js
Valeriia Ruban 663a5642c2
[UI]: update Ember to 3.27 (#16227)
* Upgrade to 3.25 via ember-cli-update

* v3.25.3...v3.26.1

* v3.26.1...v3.27.0


Co-authored-by: Michael Klein <michael@firstiwaslike.com>
2023-02-10 13:32:19 -08:00

47 lines
1.1 KiB
JavaScript

import { module, test } from 'qunit';
import leftTrim from 'consul-ui/utils/left-trim';
module('Unit | Utility | left trim', function () {
test('it trims characters from the left hand side', function (assert) {
assert.expect(8);
[
{
args: ['/a/folder/here', '/'],
expected: 'a/folder/here',
},
{
args: ['/a/folder/here', ''],
expected: '/a/folder/here',
},
{
args: ['a/folder/here', '/'],
expected: 'a/folder/here',
},
{
args: ['a/folder/here/', '/'],
expected: 'a/folder/here/',
},
{
args: [],
expected: '',
},
{
args: ['/a/folder/here', '/a/folder'],
expected: '/here',
},
{
args: ['/a/folder/here/', '/a/folder/here'],
expected: '/',
},
{
args: ['/a/folder/here/', '/a/folder/here/'],
expected: '',
},
].forEach(function (item) {
const actual = leftTrim(...item.args);
assert.equal(actual, item.expected);
});
});
});