Fix replication test (#7747)

* fix replication acceptance test

* remove unused import

* remove mountType
This commit is contained in:
Matthew Irish
2019-10-28 11:56:11 -05:00
committed by Sam Salisbury
parent a792eadbd1
commit 84dd1dfc12
2 changed files with 14 additions and 10 deletions

View File

@@ -12,7 +12,7 @@
<div class="field is-grouped is-grouped-split is-fullwidth box is-bottomless"> <div class="field is-grouped is-grouped-split is-fullwidth box is-bottomless">
<div class="field is-grouped"> <div class="field is-grouped">
<div class="control"> <div class="control">
<button type="submit" class="button is-primary" > <button type="submit" class="button is-primary" data-test-config-save>
Update Update
</button> </button>
</div> </div>

View File

@@ -1,3 +1,4 @@
import { clickTrigger } from 'ember-power-select/test-support/helpers';
import { click, fillIn, findAll, currentURL, find, visit, settled } from '@ember/test-helpers'; import { click, fillIn, findAll, currentURL, find, visit, settled } from '@ember/test-helpers';
import { module, test } from 'qunit'; import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit'; import { setupApplicationTest } from 'ember-qunit';
@@ -5,6 +6,9 @@ import authPage from 'vault/tests/pages/auth';
import { pollCluster } from 'vault/tests/helpers/poll-cluster'; import { pollCluster } from 'vault/tests/helpers/poll-cluster';
import { create } from 'ember-cli-page-object'; import { create } from 'ember-cli-page-object';
import flashMessage from 'vault/tests/pages/components/flash-message'; import flashMessage from 'vault/tests/pages/components/flash-message';
import ss from 'vault/tests/pages/components/search-select';
const searchSelect = create(ss);
const flash = create(flashMessage); const flash = create(flashMessage);
const disableReplication = async (type, assert) => { const disableReplication = async (type, assert) => {
@@ -42,8 +46,7 @@ module('Acceptance | Enterprise | replication', function(hooks) {
test('replication', async function(assert) { test('replication', async function(assert) {
const secondaryName = 'firstSecondary'; const secondaryName = 'firstSecondary';
const mode = 'blacklist'; const mode = 'deny';
const mountType = 'kv';
let mountPath; let mountPath;
await visit('/vault/replication'); await visit('/vault/replication');
@@ -60,11 +63,11 @@ module('Acceptance | Enterprise | replication', function(hooks) {
await click('[data-test-replication-link="secondaries"]'); await click('[data-test-replication-link="secondaries"]');
await click('[data-test-secondary-add]'); await click('[data-test-secondary-add]');
await fillIn('[data-test-replication-secondary-id]', secondaryName); await fillIn('[data-test-replication-secondary-id]', secondaryName);
//expand the config
await click('[data-test-replication-secondary-token-options]'); await click('#deny');
await fillIn('[data-test-replication-filter-mount-mode]', mode); await clickTrigger();
await click(findAll(`[data-test-mount-filter="${mountType}"]`)[0]); mountPath = searchSelect.options.objectAt(0).text;
mountPath = findAll(`[data-test-mount-filter-path-for-type="${mountType}"]`)[0].textContent.trim(); await searchSelect.options.objectAt(0).click();
await click('[data-test-secondary-add]'); await click('[data-test-secondary-add]');
await pollCluster(this.owner); await pollCluster(this.owner);
@@ -89,8 +92,9 @@ module('Acceptance | Enterprise | replication', function(hooks) {
// delete config // delete config
await click('[data-test-replication-link="edit-mount-config"]'); await click('[data-test-replication-link="edit-mount-config"]');
await click('[data-test-delete-mount-config] button'); await click('#no-filtering');
await click('[data-test-confirm-button]');
await click('[data-test-config-save]');
assert.equal( assert.equal(
flash.latestMessage, flash.latestMessage,
`The performance mount filter config for the secondary ${secondaryName} was successfully deleted.`, `The performance mount filter config for the secondary ${secondaryName} was successfully deleted.`,