mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-12 01:27:01 +02:00
* adds ember-flight-icons dependecy * adds inline-json-import babel plugin * adds flight icon styling * updates Icon component to support flight icons * updates Icon component usages to new api and updates name values to flight icon set when available * fixes tests * updates icon story with flight mappings and fixes issue with flight icons not rendering in storybook * adds changelog * fixes typo in sign action glyph name in transit-key model * adds comments to icon-map * updates Icon component to use only supported flight icon sizes * adds icon transform codemod * updates icon transform formatting to handle edge case * runs icon transform on templates * updates Icon usage in toolbar-filter md and story * updates tests
56 lines
2.0 KiB
JavaScript
56 lines
2.0 KiB
JavaScript
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
import { render } from '@ember/test-helpers';
|
|
import engineResolverFor from 'ember-engines/test-support/engine-resolver-for';
|
|
import { CLUSTER_STATES } from 'core/helpers/cluster-states';
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
const resolver = engineResolverFor('replication');
|
|
|
|
module('Integration | Component | replication-primary-card', function(hooks) {
|
|
setupRenderingTest(hooks, { resolver });
|
|
|
|
test('it renders', async function(assert) {
|
|
const title = 'Last WAL';
|
|
const description = 'WALL-E';
|
|
const metric = '3000';
|
|
|
|
this.set('title', title);
|
|
this.set('description', description);
|
|
this.set('metric', metric);
|
|
|
|
await render(hbs`
|
|
<ReplicationPrimaryCard
|
|
@title={{title}}
|
|
@description={{description}}
|
|
@metric='3000' />`);
|
|
|
|
assert.dom('[data-test-hasError]').doesNotExist('shows no error for non-State cards');
|
|
|
|
assert.dom('.last-wal').includesText(title);
|
|
assert.dom('[data-test-description]').includesText(description);
|
|
assert.dom('[data-test-metric]').includesText(metric);
|
|
});
|
|
|
|
Object.keys(CLUSTER_STATES).forEach(state => {
|
|
test(`it renders a card when cluster has the ${state} state`, async function(assert) {
|
|
this.set('glyph', CLUSTER_STATES[state].glyph);
|
|
this.set('state', state);
|
|
|
|
await render(hbs`
|
|
<ReplicationPrimaryCard
|
|
@title='State'
|
|
@description='Updated every ten seconds.'
|
|
@glyph={{glyph}}
|
|
@metric={{state}} />`);
|
|
|
|
if (CLUSTER_STATES[state].isOk) {
|
|
assert.dom('[data-test-hasError]').doesNotExist();
|
|
assert.dom('[data-test-cluster-state-icon]').exists('shows an icon if state is ok');
|
|
} else {
|
|
assert.dom('[data-test-hasError]').exists('shows an error if the cluster state is not ok');
|
|
assert.dom('[data-test-cluster-state-icon]').doesNotExist('does not show an icon if state is not ok');
|
|
}
|
|
});
|
|
});
|
|
});
|