datahub/wherehows-web/tests/unit/utils/datasets/metadata-acquisition-test.js

29 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-10-16 18:20:05 -07:00
import {
lastSeenSuggestionInterval,
2018-03-27 08:39:17 -07:00
lowQualitySuggestionConfidenceThreshold
2017-10-16 18:20:05 -07:00
} from 'wherehows-web/constants/metadata-acquisition';
2018-03-27 08:39:17 -07:00
import { formatAsCapitalizedStringWithSpaces } from 'wherehows-web/utils/helpers/string';
2017-10-16 18:20:05 -07:00
import { module, test } from 'qunit';
module('Unit | Utility | datasets/metadata acquisition', function() {
test('lastSeenSuggestionInterval is a number', function(assert) {
assert.ok(typeof lastSeenSuggestionInterval === 'number');
});
2017-10-16 18:20:05 -07:00
});
module('Unit | Utility | datasets/metadata acquisition', function() {
test('lowQualitySuggestionConfidenceThreshold is a number', function(assert) {
assert.ok(typeof lowQualitySuggestionConfidenceThreshold === 'number');
});
2017-10-16 18:20:05 -07:00
test('formatAsCapitalizedStringWithSpaces generates the correct display string', function(assert) {
[
['CONFIDENTIAL', 'Confidential'],
['LIMITED_DISTRIBUTION', 'Limited distribution'],
['HIGHLY_CONFIDENTIAL', 'Highly confidential']
].forEach(([source, target]) => {
assert.equal(formatAsCapitalizedStringWithSpaces(source), target, `correctly converts ${source}`);
});
});
});