vault/ui/tests/unit/services/version-test.js
Chelsea Shaw cb217388d4
UI: handle reduced disclosure endpoints (#24262)
* Create app-footer component with tests

* glimmerize vault route + controller

* Add dev mode badge to new footer

* Fix version on dashboard

* update app-footer tests

* update version title component

* Handle case for chroot namespace fail on health check

* cleanup

* fix ent tests

* add missing headers

* extra version fetch on login success, clear version on logout and seal

* Add coverage for clearing version on seal

* rename isOSS to isCommunity

* remove is-version helper

* test version in footer on unseal flow

* fix enterprise test

* VAULT-21399 test coverage

* VAULT-21400 test coverage
2023-12-04 14:28:16 -06:00

40 lines
1.2 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Service | version', function (hooks) {
setupTest(hooks);
test('setting type computes isCommunity properly', function (assert) {
const service = this.owner.lookup('service:version');
service.type = 'community';
assert.true(service.isCommunity);
assert.false(service.isEnterprise);
});
test('setting type computes isEnterprise properly', function (assert) {
const service = this.owner.lookup('service:version');
service.type = 'enterprise';
assert.false(service.isCommunity);
assert.true(service.isEnterprise);
});
test('hasPerfReplication', function (assert) {
const service = this.owner.lookup('service:version');
assert.false(service.hasPerfReplication);
service.features = ['Performance Replication'];
assert.true(service.hasPerfReplication);
});
test('hasDRReplication', function (assert) {
const service = this.owner.lookup('service:version');
assert.false(service.hasDRReplication);
service.features = ['DR Replication'];
assert.true(service.hasDRReplication);
});
});