Lock Session invalidation acceptance test

This commit is contained in:
John Cowen 2018-07-04 13:41:44 +01:00
parent 87ecae2c39
commit 75cb5f695e
6 changed files with 42 additions and 4 deletions

View File

@ -37,7 +37,7 @@
<td>
{{#confirmation-dialog message='Are you sure you want to invalidate this session?'}}
{{#block-slot 'action' as |confirm|}}
<button type="button" class="type-delete" {{action confirm 'invalidateSession' item}}>Invalidate</button>
<button data-test-delete type="button" class="type-delete" {{action confirm 'invalidateSession' item}}>Invalidate</button>
{{/block-slot}}
{{#block-slot 'dialog' as |execute cancel message|}}
<p>

View File

@ -0,0 +1,26 @@
@setupApplicationTest
Feature: dc / nodes / sessions / invalidate: Invalidate Lock Sessions
In order to invalidate a lock session
As a user
I should be able to invalidate a lock session by clicking a button and confirming
Scenario: Given 2 lock sessions
Given 1 datacenter model with the value "dc1"
And 1 node model from yaml
---
- ID: node-0
---
And 2 session models from yaml
---
- ID: 7bbbd8bb-fff3-4292-b6e3-cfedd788546a
- ID: 7ccd0bd7-a5e0-41ae-a33e-ed3793d803b2
---
When I visit the node page for yaml
---
dc: dc1
node: node-0
---
And I click lockSessions on the tabs
Then I see lockSessionsIsSelected on the tabs
And I click delete on the sessions
And I click confirmDelete on the sessions
Then a PUT request is made to "/v1/session/destroy/7bbbd8bb-fff3-4292-b6e3-cfedd788546a?dc=dc1"

View File

@ -1,5 +1,5 @@
@setupApplicationTest
Feature: dc / nodes / sessions /list: List Lock Sessions
Feature: dc / nodes / sessions / list: List Lock Sessions
In order to get information regarding lock sessions
As a user
I should be able to see a listing of lock sessions with necessary information under the lock sessions tab for a node

View File

@ -0,0 +1,10 @@
import steps from '../../../steps';
// step definitions that are shared between features should be moved to the
// tests/acceptance/steps/steps.js file
export default function(assert) {
return steps(assert).then('I should find a file', function() {
assert.ok(true, this.step);
});
}

View File

@ -1,4 +1,4 @@
import { create, visitable, collection, attribute } from 'ember-cli-page-object';
import { create, visitable, collection, attribute, clickable } from 'ember-cli-page-object';
import radiogroup from 'consul-ui/tests/lib/page-object/radiogroup';
export default create({
@ -11,6 +11,8 @@ export default create({
port: attribute('data-test-service-port', '.port'),
}),
sessions: collection('#lock-sessions [data-test-tabular-row]', {
delete: clickable('[data-test-delete]'),
confirmDelete: clickable('button.type-delete'),
TTL: attribute('data-test-session-ttl', '[data-test-session-ttl]'),
}),
});

View File

@ -5,7 +5,7 @@ import getDictionary from '@hashicorp/ember-cli-api-double/dictionary';
import pages from 'consul-ui/tests/pages';
import api from 'consul-ui/tests/helpers/api';
const dont = `( don't| shouldn't| can't)?`;
// const dont = `( don't| shouldn't| can't)?`;
const create = function(number, name, value) {
// don't return a promise here as