-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sidebranch: component and acceptance tests (#8903)
* address secondary card overflow issue * setup replicaiton header test * address secondary card overflow issue * setup replication secondary card test * setup replicaiton header test * setup replicaiton page test * setup replication secondary card test * setup replication dashboard test * setup replicaiton page test * remove unused code * fix overflow * finish test for rep dashboard * update rep secondary card test * finish rep header test * fix rep table rows and header test * fix header test * fix missing data-test-primary-cluster * add to secondary test * remove pauseTest * add to enterprise replication test * add mode to dr secondary test * remove pauseTest * add enterprise to test * amend per pr commments * re organize rep secondary card test * adjust error heights with design input * move const around in rep secondary card test * move const around and message for rep dashboard test * amend per pr review comments * remove styling from grid-item-left * remove dup hasErrorClass key * quick fix * test failure fix * fix test due to merge * remove hasErrorClass * modify test message
- Loading branch information
1 parent
241c1f0
commit f31dc15
Showing
14 changed files
with
328 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
/** | ||
* @module ReplicationHeader | ||
* ARG TODO: finish | ||
* | ||
* @example | ||
* ```js | ||
* <ReplicationHeader finish/> | ||
* ``` | ||
*/ | ||
|
||
import Component from '@ember/component'; | ||
import layout from '../templates/components/replication-header'; | ||
|
||
export default Component.extend({ | ||
layout, | ||
data: null, | ||
isSecondary: null, | ||
'data-test-replication-header': true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
ui/tests/integration/components/replication-dashboard-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
const REPLICATION_DETAILS = { | ||
state: 'stream-wals', | ||
primaryClusterAddr: 'https://127.0.0.1:8201', | ||
}; | ||
|
||
const REPLICATION_DETAILS_SYNCING = { | ||
state: 'merkle-diff', | ||
primaryClusterAddr: 'https://127.0.0.1:8201', | ||
}; | ||
|
||
module('Integration | Enterprise | Component | replication-dashboard', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
hooks.beforeEach(function() { | ||
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}} | ||
@isSecondary={{isSecondary}} | ||
/>`); | ||
|
||
assert.dom('[data-test-replication-dashboard]').exists(); | ||
assert.dom('[data-test-table-rows').exists(); | ||
assert | ||
.dom('[data-test-primary-cluster-address]') | ||
.includesText( | ||
REPLICATION_DETAILS.primaryClusterAddr, | ||
`shows the correct primary cluster address value` | ||
); | ||
assert.dom('[data-test-replication-doc-link]').exists(); | ||
assert.dom('[data-test-flash-message]').doesNotExist('no flash message is displayed on render'); | ||
}); | ||
|
||
test('it renders an alert banner if the dashboard is syncing', async function(assert) { | ||
this.set('replicationDetailsSyncing', REPLICATION_DETAILS_SYNCING); | ||
|
||
await render(hbs`<ReplicationDashboard | ||
@replicationDetails={{replicationDetailsSyncing}} | ||
@clusterMode={{clusterMode}} | ||
@isSecondary={{isSecondary}} | ||
@componentToRender='replication-secondary-card' | ||
/>`); | ||
|
||
assert.dom('[data-test-isSyncing]').exists(); | ||
assert.dom('[data-test-isReindexing]').doesNotExist(); | ||
}); | ||
}); |
Oops, something went wrong.