From 2f67754951b993e49dff1e40ce17d5315a302e22 Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Tue, 29 May 2018 09:14:31 -0500 Subject: [PATCH] UI - Active Directory secrets (#4647) * add AD secrets in the ui and move deprecated engines to the bottom of the list * fix tools tests * prettier --- ui/app/components/console/command-input.js | 2 +- ui/app/components/console/ui-panel.js | 16 ++++-- ui/app/components/identity/_popup-base.js | 2 +- ui/app/components/identity/edit-form.js | 12 ++-- ui/app/components/identity/item-details.js | 9 +-- ui/app/components/upgrade-link.js | 4 +- .../cluster/access/identity/aliases/index.js | 4 +- .../vault/cluster/access/identity/create.js | 20 +++---- .../vault/cluster/access/identity/index.js | 5 +- .../cluster/settings/mount-secret-backend.js | 11 ++-- ui/app/lib/console-helpers.js | 10 ++-- ui/app/models/identity/group-alias.js | 1 - ui/app/routes/vault/cluster.js | 2 +- .../cluster/access/identity/aliases/index.js | 2 +- .../vault/cluster/access/identity/index.js | 2 +- .../vault/cluster/secrets/backend/list.js | 2 +- ui/app/services/console.js | 6 +- .../access/identity/_shared-alias-tests.js | 39 ++++++++++--- .../access/identity/_shared-tests.js | 49 +++++++++++++---- .../identity/entities/aliases/create-test.js | 2 - .../access/identity/entities/create-test.js | 1 - .../identity/groups/aliases/create-test.js | 2 - .../settings/mount-secret-backend-test.js | 2 +- ui/tests/acceptance/tools-test.js | 12 ++-- .../components/identity/item-details-test.js | 6 +- .../components/transit-key-actions-test.js | 2 +- .../pages/access/identity/aliases/show.js | 2 +- ui/tests/pages/access/identity/create.js | 6 +- ui/tests/pages/access/identity/show.js | 2 +- .../components/identity/edit-form-test.js | 6 +- ui/tests/unit/services/store-test.js | 55 ++++++++++--------- 31 files changed, 171 insertions(+), 125 deletions(-) diff --git a/ui/app/components/console/command-input.js b/ui/app/components/console/command-input.js index 5ee6eeffe1..43854b0b7d 100644 --- a/ui/app/components/console/command-input.js +++ b/ui/app/components/console/command-input.js @@ -31,6 +31,6 @@ export default Ember.Component.extend({ }, fullscreen() { this.get('onFullscreen')(); - } + }, }, }); diff --git a/ui/app/components/console/ui-panel.js b/ui/app/components/console/ui-panel.js index fe35294d3b..61c782a817 100644 --- a/ui/app/components/console/ui-panel.js +++ b/ui/app/components/console/ui-panel.js @@ -26,8 +26,15 @@ export default Ember.Component.extend({ executeCommand(command, shouldThrow = false) { let service = this.get('console'); let serviceArgs; - - if(executeUICommand(command, (args) => this.logAndOutput(args), (args) => service.clearLog(args), () => this.toggleProperty('isFullscreen'))){ + + if ( + executeUICommand( + command, + args => this.logAndOutput(args), + args => service.clearLog(args), + () => this.toggleProperty('isFullscreen') + ) + ) { return; } @@ -55,7 +62,8 @@ export default Ember.Component.extend({ return; } let serviceFn = service[method]; - serviceFn.call(service, path, data, flags.wrapTTL) + serviceFn + .call(service, path, data, flags.wrapTTL) .then(resp => { this.logAndOutput(command, logFromResponse(resp, path, method, flags)); }) @@ -65,7 +73,7 @@ export default Ember.Component.extend({ }, shiftCommandIndex(keyCode) { - this.get('console').shiftCommandIndex(keyCode, (val) => { + this.get('console').shiftCommandIndex(keyCode, val => { this.set('inputValue', val); }); }, diff --git a/ui/app/components/identity/_popup-base.js b/ui/app/components/identity/_popup-base.js index 0cda95bc23..c74803ade2 100644 --- a/ui/app/components/identity/_popup-base.js +++ b/ui/app/components/identity/_popup-base.js @@ -16,7 +16,7 @@ export default Component.extend({ model.rollbackAttributes(); } }, - onSuccess(){}, + onSuccess() {}, // override and return a promise transaction() { assert('override transaction call in an extension of popup-base', false); diff --git a/ui/app/components/identity/edit-form.js b/ui/app/components/identity/edit-form.js index d9f1eb8c9d..59e6173b55 100644 --- a/ui/app/components/identity/edit-form.js +++ b/ui/app/components/identity/edit-form.js @@ -60,7 +60,7 @@ export default Ember.Component.extend({ return; } this.get('flashMessages').success(message); - yield this.get('onSave')({saveType: 'save', model}); + yield this.get('onSave')({ saveType: 'save', model }); }).drop(), willDestroy() { @@ -74,12 +74,10 @@ export default Ember.Component.extend({ deleteItem(model) { let message = this.getMessage(model, true); let flash = this.get('flashMessages'); - model - .destroyRecord() - .then(() => { - flash.success(message); - return this.get('onSave')({saveType: 'delete', model}); - }); + model.destroyRecord().then(() => { + flash.success(message); + return this.get('onSave')({ saveType: 'delete', model }); + }); }, }, }); diff --git a/ui/app/components/identity/item-details.js b/ui/app/components/identity/item-details.js index eae4d92b2a..eafc9fb5d8 100644 --- a/ui/app/components/identity/item-details.js +++ b/ui/app/components/identity/item-details.js @@ -9,8 +9,9 @@ export default Ember.Component.extend({ enable(model) { model.set('disabled', false); - model.save(). - then(() => { + model + .save() + .then(() => { this.get('flashMessages').success(`Successfully enabled entity: ${model.id}`); }) .catch(e => { @@ -18,6 +19,6 @@ export default Ember.Component.extend({ `There was a problem enabling the entity: ${model.id} - ${e.error.join(' ') || e.message}` ); }); - } - } + }, + }, }); diff --git a/ui/app/components/upgrade-link.js b/ui/app/components/upgrade-link.js index 95dd2dcf15..01bc9ea11d 100644 --- a/ui/app/components/upgrade-link.js +++ b/ui/app/components/upgrade-link.js @@ -7,10 +7,10 @@ export default Ember.Component.extend({ isActive: false, tagName: 'span', trackingSource: computed('pageName', function() { - let trackingSource = "vaultui"; + let trackingSource = 'vaultui'; let pageName = this.get('pageName'); if (pageName) { - trackingSource = trackingSource + "_" + encodeURIComponent(pageName); + trackingSource = trackingSource + '_' + encodeURIComponent(pageName); } return trackingSource; }), diff --git a/ui/app/controllers/vault/cluster/access/identity/aliases/index.js b/ui/app/controllers/vault/cluster/access/identity/aliases/index.js index a35db205a2..10d0973925 100644 --- a/ui/app/controllers/vault/cluster/access/identity/aliases/index.js +++ b/ui/app/controllers/vault/cluster/access/identity/aliases/index.js @@ -5,6 +5,6 @@ export default Ember.Controller.extend(ListController, { actions: { onDelete() { this.send('reload'); - } - } + }, + }, }); diff --git a/ui/app/controllers/vault/cluster/access/identity/create.js b/ui/app/controllers/vault/cluster/access/identity/create.js index 46c8a30c6e..a94bf3b4b0 100644 --- a/ui/app/controllers/vault/cluster/access/identity/create.js +++ b/ui/app/controllers/vault/cluster/access/identity/create.js @@ -4,26 +4,20 @@ import { task } from 'ember-concurrency'; export default Ember.Controller.extend({ showRoute: 'vault.cluster.access.identity.show', showTab: 'details', - navAfterSave: task(function*({saveType, model}) { + navAfterSave: task(function*({ saveType, model }) { let isDelete = saveType === 'delete'; let type = model.get('identityType'); - let listRoutes= { + let listRoutes = { 'entity-alias': 'vault.cluster.access.identity.aliases.index', 'group-alias': 'vault.cluster.access.identity.aliases.index', - 'group': 'vault.cluster.access.identity.index', - 'entity': 'vault.cluster.access.identity.index', + group: 'vault.cluster.access.identity.index', + entity: 'vault.cluster.access.identity.index', }; - let routeName = listRoutes[type] + let routeName = listRoutes[type]; if (!isDelete) { - yield this.transitionToRoute( - this.get('showRoute'), - model.id, - this.get('showTab') - ); + yield this.transitionToRoute(this.get('showRoute'), model.id, this.get('showTab')); return; } - yield this.transitionToRoute( - routeName - ); + yield this.transitionToRoute(routeName); }), }); diff --git a/ui/app/controllers/vault/cluster/access/identity/index.js b/ui/app/controllers/vault/cluster/access/identity/index.js index 6cc77a8dc7..0bfe797cff 100644 --- a/ui/app/controllers/vault/cluster/access/identity/index.js +++ b/ui/app/controllers/vault/cluster/access/identity/index.js @@ -29,8 +29,9 @@ export default Ember.Controller.extend(ListController, { let id = model.id; model.toggleProperty('disabled'); - model.save(). - then(() => { + model + .save() + .then(() => { this.get('flashMessages').success(`Successfully ${action[0]} ${type}: ${id}`); }) .catch(e => { diff --git a/ui/app/controllers/vault/cluster/settings/mount-secret-backend.js b/ui/app/controllers/vault/cluster/settings/mount-secret-backend.js index 569a281148..973d0544e9 100644 --- a/ui/app/controllers/vault/cluster/settings/mount-secret-backend.js +++ b/ui/app/controllers/vault/cluster/settings/mount-secret-backend.js @@ -7,22 +7,23 @@ const { computed } = Ember; export default Ember.Controller.extend({ mountTypes: [ + { label: 'Active Directory', value: 'ad' }, { label: 'AWS', value: 'aws' }, - { label: 'Cassandra', value: 'cassandra', deprecated: true }, { label: 'Consul', value: 'consul' }, { label: 'Databases', value: 'database' }, { label: 'Google Cloud', value: 'gcp' }, { label: 'KV', value: 'kv' }, - { label: 'MongoDB', value: 'mongodb', deprecated: true }, - { label: 'MSSQL', value: 'mssql', deprecated: true }, - { label: 'MySQL', value: 'mysql', deprecated: true }, { label: 'Nomad', value: 'nomad' }, { label: 'PKI', value: 'pki' }, - { label: 'PostgreSQL', value: 'postgresql', deprecated: true }, { label: 'RabbitMQ', value: 'rabbitmq' }, { label: 'SSH', value: 'ssh' }, { label: 'Transit', value: 'transit' }, { label: 'TOTP', value: 'totp' }, + { label: 'Cassandra', value: 'cassandra', deprecated: true }, + { label: 'MongoDB', value: 'mongodb', deprecated: true }, + { label: 'MSSQL', value: 'mssql', deprecated: true }, + { label: 'MySQL', value: 'mysql', deprecated: true }, + { label: 'PostgreSQL', value: 'postgresql', deprecated: true }, ], selectedType: null, diff --git a/ui/app/lib/console-helpers.js b/ui/app/lib/console-helpers.js index 0d8b12128d..1637063352 100644 --- a/ui/app/lib/console-helpers.js +++ b/ui/app/lib/console-helpers.js @@ -29,12 +29,12 @@ export function extractDataAndFlags(data, flags) { }, { data: {}, flags: {} }); } -export function executeUICommand(command, logAndOutput, clearLog, toggleFullscreen){ +export function executeUICommand(command, logAndOutput, clearLog, toggleFullscreen) { const isUICommand = uiCommands.includes(command); - if(isUICommand){ + if (isUICommand) { logAndOutput(command); } - switch(command){ + switch (command) { case 'clearall': clearLog(true); break; @@ -149,7 +149,9 @@ export function shiftCommandIndex(keyCode, history, index) { let newInputValue; let commandHistoryLength = history.length; - if (!commandHistoryLength) { return []; } + if (!commandHistoryLength) { + return []; + } if (keyCode === keys.UP) { index -= 1; diff --git a/ui/app/models/identity/group-alias.js b/ui/app/models/identity/group-alias.js index 3f40ca7126..47a74ebb28 100644 --- a/ui/app/models/identity/group-alias.js +++ b/ui/app/models/identity/group-alias.js @@ -35,5 +35,4 @@ export default IdentityModel.extend({ updatePath: identityCapabilities(), canDelete: computed.alias('updatePath.canDelete'), canEdit: computed.alias('updatePath.canUpdate'), - }); diff --git a/ui/app/routes/vault/cluster.js b/ui/app/routes/vault/cluster.js index 433c7f701d..a099784c91 100644 --- a/ui/app/routes/vault/cluster.js +++ b/ui/app/routes/vault/cluster.js @@ -32,7 +32,7 @@ export default Ember.Route.extend(ModelBoundaryRoute, ClusterRoute, { model(params) { const id = this.getClusterId(params); - return this.get('store').findRecord('cluster', id); + return this.get('store').findRecord('cluster', id); }, stopPoll: Ember.on('deactivate', function() { diff --git a/ui/app/routes/vault/cluster/access/identity/aliases/index.js b/ui/app/routes/vault/cluster/access/identity/aliases/index.js index df1100eae9..b0b27d0e32 100644 --- a/ui/app/routes/vault/cluster/access/identity/aliases/index.js +++ b/ui/app/routes/vault/cluster/access/identity/aliases/index.js @@ -35,6 +35,6 @@ export default Ember.Route.extend(ListRoute, { reload() { this.store.clearAllDatasets(); this.refresh(); - } + }, }, }); diff --git a/ui/app/routes/vault/cluster/access/identity/index.js b/ui/app/routes/vault/cluster/access/identity/index.js index cf43c6d6df..4b19fcb80a 100644 --- a/ui/app/routes/vault/cluster/access/identity/index.js +++ b/ui/app/routes/vault/cluster/access/identity/index.js @@ -37,6 +37,6 @@ export default Ember.Route.extend(ListRoute, { reload() { this.store.clearAllDatasets(); this.refresh(); - } + }, }, }); diff --git a/ui/app/routes/vault/cluster/secrets/backend/list.js b/ui/app/routes/vault/cluster/secrets/backend/list.js index 1731c1525a..0c8bfb5702 100644 --- a/ui/app/routes/vault/cluster/secrets/backend/list.js +++ b/ui/app/routes/vault/cluster/secrets/backend/list.js @@ -162,6 +162,6 @@ export default Ember.Route.extend({ reload() { this.refresh(); this.store.clearAllDatasets(); - } + }, }, }); diff --git a/ui/app/services/console.js b/ui/app/services/console.js index e35555f3bf..3e17842b8e 100644 --- a/ui/app/services/console.js +++ b/ui/app/services/console.js @@ -1,9 +1,7 @@ // Low level service that allows users to input paths to make requests to vault // this service provides the UI synecdote to the cli commands read, write, delete, and list import Ember from 'ember'; -import { - shiftCommandIndex, -} from 'vault/lib/console-helpers'; +import { shiftCommandIndex } from 'vault/lib/console-helpers'; const { Service, getOwner, computed } = Ember; @@ -48,7 +46,7 @@ export default Service.extend({ } }, - clearLog(clearAll=false) { + clearLog(clearAll = false) { let log = this.get('log'); let history; if (!clearAll) { diff --git a/ui/tests/acceptance/access/identity/_shared-alias-tests.js b/ui/tests/acceptance/access/identity/_shared-alias-tests.js index 284c50f7e9..7f4440bc78 100644 --- a/ui/tests/acceptance/access/identity/_shared-alias-tests.js +++ b/ui/tests/acceptance/access/identity/_shared-alias-tests.js @@ -27,21 +27,31 @@ export const testAliasCRUD = (name, itemType, assert) => { 'navigates to the correct route' ); assert.ok( - aliasShowPage.flashMessage.latestMessage.startsWith('Successfully saved', `${itemType}: shows a flash message`) + aliasShowPage.flashMessage.latestMessage.startsWith( + 'Successfully saved', + `${itemType}: shows a flash message` + ) ); assert.ok(aliasShowPage.nameContains(name), `${itemType}: renders the name on the show page`); }); aliasIndexPage.visit({ item_type: itemType }); andThen(() => { - assert.equal(aliasIndexPage.items.filterBy('id', aliasID).length, 1, `${itemType}: lists the entity in the entity list`); + assert.equal( + aliasIndexPage.items.filterBy('id', aliasID).length, + 1, + `${itemType}: lists the entity in the entity list` + ); aliasIndexPage.items.filterBy('id', aliasID)[0].menu(); }); aliasIndexPage.delete().confirmDelete(); andThen(() => { assert.equal(aliasIndexPage.items.filterBy('id', aliasID).length, 0, `${itemType}: the row is deleted`); - aliasIndexPage.flashMessage.latestMessage.startsWith('Successfully deleted', `${itemType}: shows flash message`); + aliasIndexPage.flashMessage.latestMessage.startsWith( + 'Successfully deleted', + `${itemType}: shows flash message` + ); }); }; @@ -66,12 +76,27 @@ export const testAliasDeleteFromForm = (name, itemType, assert) => { aliasShowPage.edit(); andThen(() => { - assert.equal(currentRouteName(), 'vault.cluster.access.identity.aliases.edit', `${itemType}: navigates to edit on create`); + assert.equal( + currentRouteName(), + 'vault.cluster.access.identity.aliases.edit', + `${itemType}: navigates to edit on create` + ); }); page.editForm.delete().confirmDelete(); andThen(() => { - assert.equal(currentRouteName(), 'vault.cluster.access.identity.aliases.index', `${itemType}: navigates to list page on delete`); - assert.equal(aliasIndexPage.items.filterBy('id', aliasID).length, 0, `${itemType}: the row does not show in the list`); - aliasIndexPage.flashMessage.latestMessage.startsWith('Successfully deleted', `${itemType}: shows flash message`); + assert.equal( + currentRouteName(), + 'vault.cluster.access.identity.aliases.index', + `${itemType}: navigates to list page on delete` + ); + assert.equal( + aliasIndexPage.items.filterBy('id', aliasID).length, + 0, + `${itemType}: the row does not show in the list` + ); + aliasIndexPage.flashMessage.latestMessage.startsWith( + 'Successfully deleted', + `${itemType}: shows flash message` + ); }); }; diff --git a/ui/tests/acceptance/access/identity/_shared-tests.js b/ui/tests/acceptance/access/identity/_shared-tests.js index d91409ea5d..b7fe3de59a 100644 --- a/ui/tests/acceptance/access/identity/_shared-tests.js +++ b/ui/tests/acceptance/access/identity/_shared-tests.js @@ -9,43 +9,70 @@ export const testCRUD = (name, itemType, assert) => { andThen(() => { let idRow = showPage.rows.filterBy('hasLabel').filterBy('rowLabel', 'ID')[0]; id = idRow.rowValue; - assert.equal(currentRouteName(), 'vault.cluster.access.identity.show', `${itemType}: navigates to show on create`); + assert.equal( + currentRouteName(), + 'vault.cluster.access.identity.show', + `${itemType}: navigates to show on create` + ); assert.ok( - showPage.flashMessage.latestMessage.startsWith('Successfully saved', `${itemType}: shows a flash message`) + showPage.flashMessage.latestMessage.startsWith( + 'Successfully saved', + `${itemType}: shows a flash message` + ) ); assert.ok(showPage.nameContains(name), `${itemType}: renders the name on the show page`); }); indexPage.visit({ item_type: itemType }); andThen(() => { - assert.equal(indexPage.items.filterBy('id', id).length, 1, `${itemType}: lists the entity in the entity list`); + assert.equal( + indexPage.items.filterBy('id', id).length, + 1, + `${itemType}: lists the entity in the entity list` + ); indexPage.items.filterBy('id', id)[0].menu(); }); indexPage.delete().confirmDelete(); andThen(() => { assert.equal(indexPage.items.filterBy('id', id).length, 0, `${itemType}: the row is deleted`); - indexPage.flashMessage.latestMessage.startsWith('Successfully deleted', `${itemType}: shows flash message`); + indexPage.flashMessage.latestMessage.startsWith( + 'Successfully deleted', + `${itemType}: shows flash message` + ); }); }; - export const testDeleteFromForm = (name, itemType, assert) => { let id; page.visit({ item_type: itemType }); page.editForm.name(name).submit(); andThen(() => { - id = showPage.rows.filterBy('hasLabel').filterBy('rowLabel', 'ID')[0].rowValue + id = showPage.rows.filterBy('hasLabel').filterBy('rowLabel', 'ID')[0].rowValue; }); showPage.edit(); andThen(() => { - assert.equal(currentRouteName(), 'vault.cluster.access.identity.edit', `${itemType}: navigates to edit on create`); + assert.equal( + currentRouteName(), + 'vault.cluster.access.identity.edit', + `${itemType}: navigates to edit on create` + ); }); page.editForm.delete().confirmDelete(); andThen(() => { - assert.equal(currentRouteName(), 'vault.cluster.access.identity.index', `${itemType}: navigates to list page on delete`); - assert.equal(indexPage.items.filterBy('id', id).length, 0, `${itemType}: the row does not show in the list`); - indexPage.flashMessage.latestMessage.startsWith('Successfully deleted', `${itemType}: shows flash message`); + assert.equal( + currentRouteName(), + 'vault.cluster.access.identity.index', + `${itemType}: navigates to list page on delete` + ); + assert.equal( + indexPage.items.filterBy('id', id).length, + 0, + `${itemType}: the row does not show in the list` + ); + indexPage.flashMessage.latestMessage.startsWith( + 'Successfully deleted', + `${itemType}: shows flash message` + ); }); }; - diff --git a/ui/tests/acceptance/access/identity/entities/aliases/create-test.js b/ui/tests/acceptance/access/identity/entities/aliases/create-test.js index 81e9e2b51a..d58abe26ad 100644 --- a/ui/tests/acceptance/access/identity/entities/aliases/create-test.js +++ b/ui/tests/acceptance/access/identity/entities/aliases/create-test.js @@ -8,7 +8,6 @@ moduleForAcceptance('Acceptance | /access/identity/entities/aliases/add', { }, }); - test('it allows create, list, delete of an entity alias', function(assert) { let name = `alias-${Date.now()}`; testAliasCRUD(name, 'entities', assert); @@ -18,4 +17,3 @@ test('it allows delete from the edit form', function(assert) { let name = `alias-${Date.now()}`; testAliasDeleteFromForm(name, 'entities', assert); }); - diff --git a/ui/tests/acceptance/access/identity/entities/create-test.js b/ui/tests/acceptance/access/identity/entities/create-test.js index 12b0642295..fd953e750e 100644 --- a/ui/tests/acceptance/access/identity/entities/create-test.js +++ b/ui/tests/acceptance/access/identity/entities/create-test.js @@ -29,4 +29,3 @@ test('it can be deleted from the edit form', function(assert) { let name = `entity-${Date.now()}`; testDeleteFromForm(name, 'entities', assert); }); - diff --git a/ui/tests/acceptance/access/identity/groups/aliases/create-test.js b/ui/tests/acceptance/access/identity/groups/aliases/create-test.js index d40f94e907..4a09df8be0 100644 --- a/ui/tests/acceptance/access/identity/groups/aliases/create-test.js +++ b/ui/tests/acceptance/access/identity/groups/aliases/create-test.js @@ -8,7 +8,6 @@ moduleForAcceptance('Acceptance | /access/identity/groups/aliases/add', { }, }); - test('it allows create, list, delete of an entity alias', function(assert) { let name = `alias-${Date.now()}`; testAliasCRUD(name, 'groups', assert); @@ -18,4 +17,3 @@ test('it allows delete from the edit form', function(assert) { let name = `alias-${Date.now()}`; testAliasDeleteFromForm(name, 'groups', assert); }); - diff --git a/ui/tests/acceptance/settings/mount-secret-backend-test.js b/ui/tests/acceptance/settings/mount-secret-backend-test.js index 2b761bf7c1..6708f091f2 100644 --- a/ui/tests/acceptance/settings/mount-secret-backend-test.js +++ b/ui/tests/acceptance/settings/mount-secret-backend-test.js @@ -30,7 +30,7 @@ test('it sets the ttl corrects when mounting', function(assert) { .maxTTLUnit('h') .submit(); - configPage.visit({backend: path}); + configPage.visit({ backend: path }); andThen(() => { assert.equal(configPage.defaultTTL, defaultTTLSeconds, 'shows the proper TTL'); assert.equal(configPage.maxTTL, maxTTLSeconds, 'shows the proper max TTL'); diff --git a/ui/tests/acceptance/tools-test.js b/ui/tests/acceptance/tools-test.js index e5d05d2215..36b61c7a76 100644 --- a/ui/tests/acceptance/tools-test.js +++ b/ui/tests/acceptance/tools-test.js @@ -59,14 +59,10 @@ test('tools functionality', function(assert) { }); click('[data-test-tools-submit]'); andThen(() => { - assert.ok( - find('[data-test-tools="token-lookup-row"]:eq(0)').text().match(/Creation time/i), - 'show creation time row' - ); - assert.ok( - find('[data-test-tools="token-lookup-row"]:eq(1)').text().match(/Creation ttl/i), - 'show creation ttl row' - ); + let rows = document.querySelectorAll('[data-test-tools="token-lookup-row"]'); + assert.dom(rows[0]).hasText(/Creation path/, 'show creation path row'); + assert.dom(rows[1]).hasText(/Creation time/, 'show creation time row'); + assert.dom(rows[2]).hasText(/Creation TTL/, 'show creation ttl row'); }); //rewrap diff --git a/ui/tests/integration/components/identity/item-details-test.js b/ui/tests/integration/components/identity/item-details-test.js index 4cced3a440..3e54efbdf0 100644 --- a/ui/tests/integration/components/identity/item-details-test.js +++ b/ui/tests/integration/components/identity/item-details-test.js @@ -16,7 +16,7 @@ moduleForComponent('identity/item-details', 'Integration | Component | identity/ }, afterEach() { component.removeContext(); - } + }, }); test('it renders the disabled warning', function(assert) { @@ -25,7 +25,7 @@ test('it renders the disabled warning', function(assert) { return Ember.RSVP.resolve(); }, disabled: true, - canEdit: true + canEdit: true, }); sinon.spy(model, 'save'); this.set('model', model); @@ -38,7 +38,7 @@ test('it renders the disabled warning', function(assert) { test('it does not render the button if canEdit is false', function(assert) { let model = Ember.Object.create({ - disabled: true + disabled: true, }); this.set('model', model); diff --git a/ui/tests/integration/components/transit-key-actions-test.js b/ui/tests/integration/components/transit-key-actions-test.js index 82bbb24f0b..a6e29f1d47 100644 --- a/ui/tests/integration/components/transit-key-actions-test.js +++ b/ui/tests/integration/components/transit-key-actions-test.js @@ -279,7 +279,7 @@ test('it includes algorithm param for HMAC', function(assert) { backend: 'transit', id: 'akey', payload: { - algorithm: "sha2-384" + algorithm: 'sha2-384', }, }, 'passes expected args to the adapter' diff --git a/ui/tests/pages/access/identity/aliases/show.js b/ui/tests/pages/access/identity/aliases/show.js index 5ca908ad8d..d12dc6c33a 100644 --- a/ui/tests/pages/access/identity/aliases/show.js +++ b/ui/tests/pages/access/identity/aliases/show.js @@ -7,5 +7,5 @@ export default create({ flashMessage, nameContains: contains('[data-test-alias-name]'), rows: collection('[data-test-component="info-table-row"]', infoTableRow), - edit: clickable('[data-test-alias-edit-link]') + edit: clickable('[data-test-alias-edit-link]'), }); diff --git a/ui/tests/pages/access/identity/create.js b/ui/tests/pages/access/identity/create.js index 8fbaac076a..2fa8092a86 100644 --- a/ui/tests/pages/access/identity/create.js +++ b/ui/tests/pages/access/identity/create.js @@ -6,8 +6,8 @@ export default create({ editForm, createItem(item_type, type) { if (type) { - return this.visit({item_type}).editForm.type(type).submit(); + return this.visit({ item_type }).editForm.type(type).submit(); } - return this.visit({item_type}).editForm.submit(); - } + return this.visit({ item_type }).editForm.submit(); + }, }); diff --git a/ui/tests/pages/access/identity/show.js b/ui/tests/pages/access/identity/show.js index ffaf79da08..12971978a5 100644 --- a/ui/tests/pages/access/identity/show.js +++ b/ui/tests/pages/access/identity/show.js @@ -7,5 +7,5 @@ export default create({ flashMessage, nameContains: contains('[data-test-identity-item-name]'), rows: collection('[data-test-component="info-table-row"]', infoTableRow), - edit: clickable('[data-test-entity-edit-link]') + edit: clickable('[data-test-entity-edit-link]'), }); diff --git a/ui/tests/unit/components/identity/edit-form-test.js b/ui/tests/unit/components/identity/edit-form-test.js index 82aae87cdb..3006c1b9cf 100644 --- a/ui/tests/unit/components/identity/edit-form-test.js +++ b/ui/tests/unit/components/identity/edit-form-test.js @@ -64,10 +64,6 @@ testCases.forEach(function(testCase) { component.set('mode', testCase.mode); component.set('model', model); - assert.equal( - component.get('cancelLink'), - testCase.expected, - 'cancel link is correct' - ); + assert.equal(component.get('cancelLink'), testCase.expected, 'cancel link is correct'); }); }); diff --git a/ui/tests/unit/services/store-test.js b/ui/tests/unit/services/store-test.js index 4476176c3d..2b5b620262 100644 --- a/ui/tests/unit/services/store-test.js +++ b/ui/tests/unit/services/store-test.js @@ -129,14 +129,16 @@ test('store.fetchPage', function(assert) { ); Ember.run(() => { - store.fetchPage('transit-key', { - size: pageSize, - page: 3, - responsePath: 'data.keys', - }).then(r => { - result = r; - done() - }); + store + .fetchPage('transit-key', { + size: pageSize, + page: 3, + responsePath: 'data.keys', + }) + .then(r => { + result = r; + done(); + }); }); const pageThreeEnd = 3 * pageSize; @@ -148,15 +150,16 @@ test('store.fetchPage', function(assert) { ); Ember.run(() => { - store.fetchPage('transit-key', { - size: pageSize, - page: 99, - responsePath: 'data.keys', - }).then(r => { - - result = r; - done(); - }); + store + .fetchPage('transit-key', { + size: pageSize, + page: 99, + responsePath: 'data.keys', + }) + .then(r => { + result = r; + done(); + }); }); assert.deepEqual( @@ -166,14 +169,16 @@ test('store.fetchPage', function(assert) { ); Ember.run(() => { - store.fetchPage('transit-key', { - size: pageSize, - page: 0, - responsePath: 'data.keys', - }).then(r => { - result = r; - done(); - }); + store + .fetchPage('transit-key', { + size: pageSize, + page: 0, + responsePath: 'data.keys', + }) + .then(r => { + result = r; + done(); + }); }); assert.deepEqual( result.mapBy('id'),