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) {
|
2018-09-25 16:28:26 +00:00
|
|
|
let service = this.owner.lookup('service:version');
|
|
|
|
service.set('version', '0.9.5');
|
|
|
|
assert.equal(service.get('isOSS'), true);
|
|
|
|
assert.equal(service.get('isEnterprise'), false);
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('setting version computes isEnterprise properly', function (assert) {
|
2018-09-25 16:28:26 +00:00
|
|
|
let service = this.owner.lookup('service:version');
|
|
|
|
service.set('version', '0.9.5+prem');
|
|
|
|
assert.equal(service.get('isOSS'), false);
|
|
|
|
assert.equal(service.get('isEnterprise'), true);
|
|
|
|
});
|
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) {
|
2018-09-25 16:28:26 +00:00
|
|
|
let service = this.owner.lookup('service:version');
|
|
|
|
service.set('version', '0.9.5+prem.hsm');
|
|
|
|
assert.equal(service.get('isOSS'), false);
|
|
|
|
assert.equal(service.get('isEnterprise'), true);
|
|
|
|
});
|
2018-05-10 21:44:17 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('hasPerfReplication', function (assert) {
|
2018-09-25 16:28:26 +00:00
|
|
|
let service = this.owner.lookup('service:version');
|
|
|
|
assert.equal(service.get('hasPerfReplication'), false);
|
|
|
|
service.set('_features', ['Performance Replication']);
|
|
|
|
assert.equal(service.get('hasPerfReplication'), true);
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('hasDRReplication', function (assert) {
|
2018-09-25 16:28:26 +00:00
|
|
|
let service = this.owner.lookup('service:version');
|
|
|
|
assert.equal(service.get('hasDRReplication'), false);
|
|
|
|
service.set('_features', ['DR Replication']);
|
|
|
|
assert.equal(service.get('hasDRReplication'), true);
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|