2023-03-15 16:00:52 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupTest } from 'ember-qunit';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
module('Unit | Service | version', function (hooks) {
|
2018-09-25 16:28:26 +00:00
|
|
|
setupTest(hooks);
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('setting version computes isOSS properly', function (assert) {
|
2022-11-09 23:15:31 +00:00
|
|
|
const service = this.owner.lookup('service:version');
|
2023-05-03 19:03:28 +00:00
|
|
|
service.version = '0.9.5';
|
|
|
|
assert.true(service.isOSS);
|
|
|
|
assert.false(service.isEnterprise);
|
2018-09-25 16:28:26 +00:00
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('setting version computes isEnterprise properly', function (assert) {
|
2022-11-09 23:15:31 +00:00
|
|
|
const service = this.owner.lookup('service:version');
|
2023-05-03 19:03:28 +00:00
|
|
|
service.version = '0.9.5+ent';
|
|
|
|
assert.false(service.isOSS);
|
|
|
|
assert.true(service.isEnterprise);
|
2018-09-25 16:28:26 +00:00
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('setting version with hsm ending computes isEnterprise properly', function (assert) {
|
2022-11-09 23:15:31 +00:00
|
|
|
const service = this.owner.lookup('service:version');
|
2023-05-03 19:03:28 +00:00
|
|
|
service.version = '0.9.5+ent.hsm';
|
|
|
|
assert.false(service.isOSS);
|
|
|
|
assert.true(service.isEnterprise);
|
2018-09-25 16:28:26 +00:00
|
|
|
});
|
2018-05-10 21:44:17 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('hasPerfReplication', function (assert) {
|
2022-11-09 23:15:31 +00:00
|
|
|
const service = this.owner.lookup('service:version');
|
2023-05-03 19:03:28 +00:00
|
|
|
assert.false(service.hasPerfReplication);
|
|
|
|
service.features = ['Performance Replication'];
|
|
|
|
assert.true(service.hasPerfReplication);
|
2018-09-25 16:28:26 +00:00
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('hasDRReplication', function (assert) {
|
2022-11-09 23:15:31 +00:00
|
|
|
const service = this.owner.lookup('service:version');
|
2023-05-03 19:03:28 +00:00
|
|
|
assert.false(service.hasDRReplication);
|
|
|
|
service.features = ['DR Replication'];
|
|
|
|
assert.true(service.hasDRReplication);
|
2018-09-25 16:28:26 +00:00
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|