Move deleting to a top level feature

This commit is contained in:
John Cowen 2018-07-04 15:58:09 +01:00
parent b7c806a061
commit ea43f04c8e
9 changed files with 43 additions and 66 deletions

View File

@ -64,7 +64,7 @@
{{# if (and item.ID (not-eq item.ID 'anonymous')) }} {{# if (and item.ID (not-eq item.ID 'anonymous')) }}
{{#confirmation-dialog message='Are you sure you want to delete this Intention?'}} {{#confirmation-dialog message='Are you sure you want to delete this Intention?'}}
{{#block-slot 'action' as |confirm|}} {{#block-slot 'action' as |confirm|}}
<button type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button> <button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button>
{{/block-slot}} {{/block-slot}}
{{#block-slot 'dialog' as |execute cancel message|}} {{#block-slot 'dialog' as |execute cancel message|}}
<p> <p>

View File

@ -58,7 +58,7 @@
<a href={{href-to 'dc.intentions.edit' item.ID}}>Edit</a> <a href={{href-to 'dc.intentions.edit' item.ID}}>Edit</a>
</li> </li>
<li> <li>
<a onclick={{action confirm 'delete' item}}>Delete</a> <a data-test-delete onclick={{action confirm 'delete' item}}>Delete</a>
</li> </li>
</ul> </ul>
{{/action-group}} {{/action-group}}

View File

@ -33,7 +33,7 @@
<button type="reset" {{ action "cancel" item parent}}>Cancel changes</button> <button type="reset" {{ action "cancel" item parent}}>Cancel changes</button>
{{#confirmation-dialog message='Are you sure you want to delete this key?'}} {{#confirmation-dialog message='Are you sure you want to delete this key?'}}
{{#block-slot 'action' as |confirm|}} {{#block-slot 'action' as |confirm|}}
<button type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button> <button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button>
{{/block-slot}} {{/block-slot}}
{{#block-slot 'dialog' as |execute cancel message|}} {{#block-slot 'dialog' as |execute cancel message|}}
<p> <p>

View File

@ -2,7 +2,7 @@
"name": "consul-ui", "name": "consul-ui",
"version": "2.2.0", "version": "2.2.0",
"private": true, "private": true,
"description": "The web ui for Consul, by HashiCorp.", "description": "The web UI for Consul, by HashiCorp.",
"directories": { "directories": {
"doc": "doc", "doc": "doc",
"test": "tests" "test": "tests"

View File

@ -1,32 +0,0 @@
@setupApplicationTest
Feature: dc / acls / delete: ACL Delete
Scenario: Deleting an ACL from the ACL listing page
Given 1 datacenter model with the value "datacenter"
And 1 acl model from yaml
---
Name: something
ID: key
---
When I visit the acls page for yaml
---
dc: datacenter
---
And I click actions on the acls
And I click delete on the acls
And I click confirmDelete on the acls
Then a PUT request is made to "/v1/acl/destroy/key?dc=datacenter"
Scenario: Deleting an ACL from the ACL detail page
Given 1 datacenter model with the value "datacenter"
And 1 acl model from yaml
---
Name: something
ID: key
---
When I visit the acl page for yaml
---
dc: datacenter
acl: something
---
And I click delete
And I click confirmDelete
Then a PUT request is made to "/v1/acl/destroy/something?dc=datacenter"

View File

@ -1,16 +0,0 @@
@setupApplicationTest
Feature: dc / kvs / delete: KV Delete
Scenario: Delete ACL
Given 1 datacenter model with the value "datacenter"
And 1 kv model from yaml
---
- key-name
---
When I visit the kvs page for yaml
---
dc: datacenter
---
And I click actions on the kvs
And I click delete on the kvs
And I click confirmDelete on the kvs
Then a DELETE request is made to "/v1/kv/key-name?dc=datacenter"

View File

@ -0,0 +1,34 @@
@setupApplicationTest
Feature: deleting: Deleting form the listing and the detail page with confirmation
Scenario: Deleting a [Model] from the [Model] listing page
Given 1 datacenter model with the value "datacenter"
And 1 [Model] model from json
---
[Data]
---
When I visit the [Model]s page for yaml
---
dc: datacenter
---
And I click actions on the [Model]s
And I click delete on the [Model]s
And I click confirmDelete on the [Model]s
Then a [Method] request is made to "[URL]"
When I visit the [Model] page for yaml
---
dc: datacenter
[Slug]
---
And I click delete
And I click confirmDelete
Then a [Method] request is made to "[URL]"
Where:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Model | Method | URL | Data | Slug |
| acl | PUT | /v1/acl/destroy/something?dc=datacenter | {"Name": "something", "ID": "something"} | acl: something |
| kv | DELETE | /v1/kv/key-name?dc=datacenter | ["key-name"] | kv: key-name |
| intention | DELETE | /v1/connect/intentions/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=datacenter | {"SourceName": "name", "ID": "ee52203d-989f-4f7a-ab5a-2bef004164ca"} | intention: ee52203d-989f-4f7a-ab5a-2bef004164ca |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ignore
Scenario: Sort out the wide tables ^
Then ok

View File

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