mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
UI: [VAULT-12979] Dashboard Landing Page (#21057)
Co-authored-by: Chelsea Shaw <cshaw@hashicorp.com> Co-authored-by: clairebontempo@gmail.com <clairebontempo@gmail.com> Co-authored-by: Angel Garbarino <angel@hashicorp.com>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'vault/tests/helpers';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
import { setupMirage } from 'ember-cli-mirage/test-support';
|
||||
import SELECTORS from 'vault/tests/helpers/components/dashboard/replication-card';
|
||||
|
||||
module('Integration | Component | dashboard/replication-state-text', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
setupMirage(hooks);
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
this.name = 'DR Primary';
|
||||
this.clusterState = {
|
||||
glyph: 'circle-check',
|
||||
isOk: true,
|
||||
};
|
||||
});
|
||||
|
||||
test('it displays replication states', async function (assert) {
|
||||
await render(
|
||||
hbs`
|
||||
<Dashboard::ReplicationStateText
|
||||
@name={{this.name}}
|
||||
@version={{this.version}}
|
||||
@subText={{this.subText}}
|
||||
@clusterStates={{this.clusterStates}} />
|
||||
`
|
||||
);
|
||||
assert.dom(SELECTORS.getReplicationTitle('dr-perf', 'DR primary')).hasText('DR primary');
|
||||
assert.dom(SELECTORS.getStateTooltipTitle('dr-perf', 'DR primary')).hasText('running');
|
||||
assert.dom(SELECTORS.getStateTooltipIcon('dr-perf', 'DR primary', 'check-circle')).exists();
|
||||
|
||||
this.name = 'DR Primary';
|
||||
this.clusterState = {
|
||||
glyph: 'x-circle',
|
||||
isOk: false,
|
||||
};
|
||||
await render(
|
||||
hbs`
|
||||
<Dashboard::ReplicationStateText
|
||||
@name={{this.name}}
|
||||
@version={{this.version}}
|
||||
@subText={{this.subText}}
|
||||
@clusterStates={{this.clusterStates}} />
|
||||
`
|
||||
);
|
||||
assert.dom(SELECTORS.getReplicationTitle('dr-perf', 'Perf primary')).hasText('Perf primary');
|
||||
assert.dom(SELECTORS.getStateTooltipTitle('dr-perf', 'Perf primary')).hasText('running');
|
||||
assert.dom(SELECTORS.getStateTooltipIcon('dr-perf', 'Perf primary', 'x-circle')).exists();
|
||||
assert
|
||||
.dom(SELECTORS.getStateTooltipIcon('dr-perf', 'Perf primary', 'x-circle'))
|
||||
.hasClass('has-text-danger');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user