open-vault/ui/tests/unit/services/version-test.js
Matthew Irish d509588cd2
Ember update (#5386)
Ember update - update ember-cli, ember-data, and ember to 3.4 series
2018-09-25 11:28:26 -05:00

42 lines
1.5 KiB
JavaScript

import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Service | version', function(hooks) {
setupTest(hooks);
test('setting version computes isOSS properly', function(assert) {
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);
});
test('setting version computes isEnterprise properly', function(assert) {
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);
});
test('setting version with hsm ending computes isEnterprise properly', function(assert) {
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);
});
test('hasPerfReplication', function(assert) {
let service = this.owner.lookup('service:version');
assert.equal(service.get('hasPerfReplication'), false);
service.set('_features', ['Performance Replication']);
assert.equal(service.get('hasPerfReplication'), true);
});
test('hasDRReplication', function(assert) {
let service = this.owner.lookup('service:version');
assert.equal(service.get('hasDRReplication'), false);
service.set('_features', ['DR Replication']);
assert.equal(service.get('hasDRReplication'), true);
});
});