2020-06-15 21:53:48 +00:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
|
|
import { changelogUrlFor } from '../../../helpers/changelog-url-for';
|
|
|
|
|
2021-10-07 17:38:12 +00:00
|
|
|
const CHANGELOG_URL = 'https://www.github.com/hashicorp/vault/blob/main/CHANGELOG.md#';
|
2020-06-15 21:53:48 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
module('Integration | Helper | changelog-url-for', function (hooks) {
|
2020-06-15 21:53:48 +00:00
|
|
|
setupRenderingTest(hooks);
|
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('it builds an enterprise URL', function (assert) {
|
2020-06-15 21:53:48 +00:00
|
|
|
const result = changelogUrlFor(['1.5.0+prem']);
|
2020-12-08 17:21:48 +00:00
|
|
|
assert.equal(result, CHANGELOG_URL.concat('150'));
|
2020-06-15 21:53:48 +00:00
|
|
|
});
|
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('it builds an OSS URL', function (assert) {
|
2020-06-15 21:53:48 +00:00
|
|
|
const result = changelogUrlFor(['1.4.3']);
|
2020-12-08 17:21:48 +00:00
|
|
|
assert.equal(result, CHANGELOG_URL.concat('143'));
|
2020-06-15 21:53:48 +00:00
|
|
|
});
|
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('it returns the base changelog URL if the version is less than 1.4.3', function (assert) {
|
2020-06-15 21:53:48 +00:00
|
|
|
const result = changelogUrlFor(['1.4.0']);
|
|
|
|
assert.equal(result, CHANGELOG_URL);
|
|
|
|
});
|
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('it returns the base changelog URL if version cannot be found', function (assert) {
|
2020-06-15 21:53:48 +00:00
|
|
|
const result = changelogUrlFor(['']);
|
|
|
|
assert.equal(result, CHANGELOG_URL);
|
|
|
|
});
|
|
|
|
});
|