Skip to content

Commit

Permalink
ensure dashboard updates when replication mode has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
andaley committed May 14, 2020
1 parent c73c478 commit 4abcd03
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions ui/tests/integration/components/replication-dashboard-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ module('Integration | Enterprise | Component | replication-dashboard', function(
setupRenderingTest(hooks);

hooks.beforeEach(function() {
this.set('replicationDetails', REPLICATION_DETAILS);
this.set('clusterMode', 'secondary');
this.set('isSecondary', true);
});

test('it renders', async function(assert) {
this.set('replicationDetails', REPLICATION_DETAILS);

await render(hbs`<ReplicationDashboard
@replicationDetails={{replicationDetails}}
@clusterMode={{clusterMode}}
Expand All @@ -48,8 +47,22 @@ module('Integration | Enterprise | Component | replication-dashboard', function(
assert.dom('[data-test-flash-message]').doesNotExist('no flash message is displayed on render');
});

test('it updates the dashboard when the replication mode has changed', async function(assert) {
await render(hbs`<ReplicationDashboard
@replicationDetails={{replicationDetails}}
@clusterMode={{clusterMode}}
@isSecondary={{isSecondary}}
/>`);

assert.dom('[data-test-selectable-card-container="secondary"]').exists();

this.set('clusterMode', 'primary');
this.set('isSecondary', false);

assert.dom('[data-test-selectable-card-container="primary"]').exists();
});

test('it renders the primary selectable-card-container when the cluster is a primary', async function(assert) {
this.set('replicationDetails', REPLICATION_DETAILS);
this.set('isSecondary', false);

await render(hbs`<ReplicationDashboard
Expand Down

0 comments on commit 4abcd03

Please sign in to comment.