mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 18:05:42 +03:00
* Allocation page linkfix * fix added to task page and computed prop moved to allocation model * Fallback query added to task group when specific volume isnt knowable * Delog * link text reflects alloc suffix * Helper instead of in-template conditionals * formatVolumeName unit test * Removing unused helper import
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
import { module, test } from 'qunit';
|
|
import { formatVolumeName } from 'nomad-ui/helpers/format-volume-name';
|
|
|
|
module('Unit | Helper | formatVolumeName', function () {
|
|
test('Returns source as string when isPerAlloc is false', function (assert) {
|
|
const expectation = 'my-volume-source';
|
|
assert.equal(
|
|
formatVolumeName(null, {
|
|
source: 'my-volume-source',
|
|
isPerAlloc: false,
|
|
volumeExtension: '[arbitrary]',
|
|
}),
|
|
expectation,
|
|
'false perAlloc'
|
|
);
|
|
assert.equal(
|
|
formatVolumeName(null, {
|
|
source: 'my-volume-source',
|
|
isPerAlloc: null,
|
|
volumeExtension: '[arbitrary]',
|
|
}),
|
|
expectation,
|
|
'null perAlloc'
|
|
);
|
|
});
|
|
|
|
test('Returns concatonated name when isPerAlloc is true', function (assert) {
|
|
const expectation = 'my-volume-source[1]';
|
|
assert.equal(
|
|
formatVolumeName(null, {
|
|
source: 'my-volume-source',
|
|
isPerAlloc: true,
|
|
volumeExtension: '[1]',
|
|
}),
|
|
expectation,
|
|
expectation
|
|
);
|
|
});
|
|
});
|