Files
vault/ui/tests/unit/services/version-test.js
Chelsea Shaw 6091ad4f71 Remove internal version endpoint (#25998)
* VAULT-24469 use sys/seal-status instead of internal version endpoint

* Update tests and mirage handlers

* Revert "VAULT-20669: Add New Authenticated Endpoint for Version  (#23740)"

This reverts commit 550c99ae3b.

* Readded version_test.go

* Reverted any old changes on versionlgo

---------

Co-authored-by: divyaac <divyaac@berkeley.edu>
2024-03-21 09:14:22 -07:00

50 lines
1.6 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('calculates versionDisplay correctly', function (assert) {
const service = this.owner.lookup('service:version');
service.type = 'community';
service.version = '1.2.3';
assert.strictEqual(service.versionDisplay, 'v1.2.3');
service.type = 'enterprise';
service.version = '1.4.7+ent';
assert.strictEqual(service.versionDisplay, 'v1.4.7');
});
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);
});
});