Skip to content

Commit

Permalink
fix enterprise test (#9229)
Browse files Browse the repository at this point in the history
* fix enterprise test

* add n

* add another n
  • Loading branch information
Monkeychip authored Jun 15, 2020
1 parent dd81267 commit 87d29b4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<p class="has-text-grey is-size-8">
The last WAL index that the secondary received from the primary. Updates every 10 seconds.
</p>
<h2 class="title is-3" data-test-lastRemoteWAL>
<h2 class="title is-3">
{{format-number lastRemoteWAL}}
</h2>
</div>
Expand Down
29 changes: 19 additions & 10 deletions ui/tests/integration/components/replication-secondary-card-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

const TITLE = 'States';
const TITLE = 'Status';

const REPLICATION_DETAILS = {
state: 'stream-wals',
connection_state: 'ready',
lastRemoteWAL: 10,
primaryClusterAddr: 'https://127.0.0.1:8201',
};

const KNOWN_PRIMARY_CLUSTER_DETAILS = {
knownPrimaryClusterAddrs: ['https://127.0.0.1:8201', 'https://127.0.0.1:8202'],
};

const STATE_ERROR = {
Expand Down Expand Up @@ -43,14 +46,20 @@ module('Integration | Enterprise | Component | replication-secondary-card', func
.includesText(REPLICATION_DETAILS.connection_state, `shows the correct connection value`);
});

test('it renders with lastRemoteWAL and primaryAddress set when title is not States', async function(assert) {
await render(hbs`<ReplicationSecondaryCard @replicationDetails={{replicationDetails}} />`);
assert
.dom('[data-test-lastRemoteWAL]')
.includesText(REPLICATION_DETAILS.lastRemoteWAL, `shows the correct lastRemoteWAL value`);
assert
.dom('[data-test-primaryClusterAddr]')
.includesText(REPLICATION_DETAILS.primaryClusterAddr, `shows the correct primaryClusterAddr value`);
test('it renders with knownPrimaryClusterAddrs set when title is not Status', async function(assert) {
this.set('replicationDetails', KNOWN_PRIMARY_CLUSTER_DETAILS);
await render(
hbs`<ReplicationSecondaryCard @replicationDetails={{replicationDetails}} @title='Primary cluster'/>`
);
assert.dom('[data-test-info-table]').exists();
});

test('it renders with emptyState if no knownPrimaryClusterAddrs are set', async function(assert) {
this.set('replicationDetails', []);
await render(
hbs`<ReplicationSecondaryCard @replicationDetails={{replicationDetails}} @title='Primary cluster'/>`
);
assert.dom('[data-test-component="empty-state"]').exists();
});

test('it renders tooltip with check-circle-outline when state is stream-wals', async function(assert) {
Expand Down

0 comments on commit 87d29b4

Please sign in to comment.