Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix enterprise test #9229

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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