diff --git a/ui-v2/app/templates/dc/acls/edit.hbs b/ui-v2/app/templates/dc/acls/edit.hbs
index e63de26726..4a6f703016 100644
--- a/ui-v2/app/templates/dc/acls/edit.hbs
+++ b/ui-v2/app/templates/dc/acls/edit.hbs
@@ -1,7 +1,7 @@
{{#app-view class="acl edit" loading=isLoading}}
{{#block-slot 'breadcrumbs'}}
- - All Tokens
+ - All Tokens
{{/block-slot}}
{{#block-slot 'header'}}
diff --git a/ui-v2/app/templates/dc/acls/index.hbs b/ui-v2/app/templates/dc/acls/index.hbs
index 1ca1224ed0..7587d4f2ca 100644
--- a/ui-v2/app/templates/dc/acls/index.hbs
+++ b/ui-v2/app/templates/dc/acls/index.hbs
@@ -5,7 +5,7 @@
{{/block-slot}}
{{#block-slot 'actions'}}
- Create
+ Create
{{/block-slot}}
{{#block-slot 'toolbar'}}
{{#if (gt items.length 0) }}
diff --git a/ui-v2/app/templates/dc/intentions/edit.hbs b/ui-v2/app/templates/dc/intentions/edit.hbs
index fa90174940..3fc2ba45d1 100644
--- a/ui-v2/app/templates/dc/intentions/edit.hbs
+++ b/ui-v2/app/templates/dc/intentions/edit.hbs
@@ -1,7 +1,7 @@
{{#app-view class="acl edit" loading=isLoading}}
{{#block-slot 'breadcrumbs'}}
- - All Intentions
+ - All Intentions
{{/block-slot}}
{{#block-slot 'header'}}
diff --git a/ui-v2/app/templates/dc/intentions/index.hbs b/ui-v2/app/templates/dc/intentions/index.hbs
index edbb49d6f9..dfde3056f7 100644
--- a/ui-v2/app/templates/dc/intentions/index.hbs
+++ b/ui-v2/app/templates/dc/intentions/index.hbs
@@ -5,7 +5,7 @@
{{/block-slot}}
{{#block-slot 'actions'}}
- Create
+ Create
{{/block-slot}}
{{#block-slot 'toolbar'}}
{{#if (gt items.length 0) }}
diff --git a/ui-v2/app/templates/dc/kv/edit.hbs b/ui-v2/app/templates/dc/kv/edit.hbs
index c156c1849d..22c7b39734 100644
--- a/ui-v2/app/templates/dc/kv/edit.hbs
+++ b/ui-v2/app/templates/dc/kv/edit.hbs
@@ -1,7 +1,7 @@
{{#app-view class="kv edit" loading=isLoading}}
{{#block-slot 'breadcrumbs'}}
- - Key / Values
+ - Key / Values
{{#if (not-eq parent.Key '/') }}
{{#each (slice 0 -1 (split parent.Key '/')) as |breadcrumb index|}}
- {{breadcrumb}}
diff --git a/ui-v2/app/templates/dc/kv/index.hbs b/ui-v2/app/templates/dc/kv/index.hbs
index a7822eda65..0733bef0cb 100644
--- a/ui-v2/app/templates/dc/kv/index.hbs
+++ b/ui-v2/app/templates/dc/kv/index.hbs
@@ -27,9 +27,9 @@
{{/block-slot}}
{{#block-slot 'actions'}}
{{#if (not-eq parent.Key '/') }}
- Create
+ Create
{{else}}
- Create
+ Create
{{/if}}
{{/block-slot}}
{{#block-slot 'content'}}
diff --git a/ui-v2/app/templates/dc/nodes/show.hbs b/ui-v2/app/templates/dc/nodes/show.hbs
index 78586c65ee..ee143d8822 100644
--- a/ui-v2/app/templates/dc/nodes/show.hbs
+++ b/ui-v2/app/templates/dc/nodes/show.hbs
@@ -1,7 +1,7 @@
{{#app-view class="node show"}}
{{#block-slot 'breadcrumbs'}}
- - All Nodes
+ - All Nodes
{{/block-slot}}
{{#block-slot 'header'}}
diff --git a/ui-v2/app/templates/dc/services/show.hbs b/ui-v2/app/templates/dc/services/show.hbs
index 0836ccd9a0..d2163548a6 100644
--- a/ui-v2/app/templates/dc/services/show.hbs
+++ b/ui-v2/app/templates/dc/services/show.hbs
@@ -1,7 +1,7 @@
{{#app-view class="service show"}}
{{#block-slot 'breadcrumbs'}}
- - All Services
+ - All Services
{{/block-slot}}
{{#block-slot 'header'}}
diff --git a/ui-v2/tests/acceptance/page-navigation.feature b/ui-v2/tests/acceptance/page-navigation.feature
index 73d83beb18..1ec219f272 100644
--- a/ui-v2/tests/acceptance/page-navigation.feature
+++ b/ui-v2/tests/acceptance/page-navigation.feature
@@ -8,38 +8,58 @@ Feature: Page Navigation
dc: dc-1
---
Then the url should be /dc-1/services
- Scenario: Clicking [Link] in the navigation takes me to [Url]
+ Scenario: Clicking [Link] in the navigation takes me to [URL]
When I visit the services page for yaml
---
dc: dc-1
---
When I click [Link] on the navigation
- Then the url should be [Url]
+ Then the url should be [URL]
Where:
----------------------------------------
- | Link | Url |
+ | Link | URL |
| nodes | /dc-1/nodes |
| kvs | /dc-1/kv |
| acls | /dc-1/acls |
| intentions | /dc-1/intentions |
| settings | /settings |
----------------------------------------
- Scenario: Clicking a [Item] in the [Model] listing
+ Scenario: Clicking a [Item] in the [Model] listing and back again
When I visit the [Model] page for yaml
---
dc: dc-1
---
When I click [Item] on the [Model]
- Then the url should be [Url]
+ Then the url should be [URL]
+ # This should be a page object function
+ And I click "[data-test-back]"
+ Then the url should be [Back]
Where:
- -------------------------------------------------------------------------------------
- | Item | Model | Url |
- | service | services | /dc-1/services/service-0 |
- | node | nodes | /dc-1/nodes/node-0 |
- | kv | kvs | /dc-1/kv/necessitatibus-0/edit |
- | intention | intentions | /dc-1/intentions/ee52203d-989f-4f7a-ab5a-2bef004164ca |
- | acl | acls | /dc-1/acls/anonymous |
- -------------------------------------------------------------------------------------
+ --------------------------------------------------------------------------------------------------------
+ | Item | Model | URL | Back |
+ | service | services | /dc-1/services/service-0 | /dc-1/services |
+ | node | nodes | /dc-1/nodes/node-0 | /dc-1/nodes |
+ | kv | kvs | /dc-1/kv/necessitatibus-0/edit | /dc-1/kv |
+ | acl | acls | /dc-1/acls/anonymous | /dc-1/acls |
+ | intention | intentions | /dc-1/intentions/ee52203d-989f-4f7a-ab5a-2bef004164ca | /dc-1/intentions |
+ --------------------------------------------------------------------------------------------------------
@ignore
Scenario: Clicking items in the listings, without depending on the salt ^
Then ok
+ Scenario: Clicking create in the [Model] listing
+ When I visit the [Model] page for yaml
+ ---
+ dc: dc-1
+ ---
+ When I click create
+ Then the url should be [URL]
+ # This should be a page object function
+ And I click "[data-test-back]"
+ Then the url should be [Back]
+ Where:
+ ------------------------------------------------------------------------
+ | Item | Model | URL | Back |
+ | kv | kvs | /dc-1/kv/create | /dc-1/kv |
+ | acl | acls | /dc-1/acls/create | /dc-1/acls |
+ | intention | intentions | /dc-1/intentions/create | /dc-1/intentions |
+ ------------------------------------------------------------------------
diff --git a/ui-v2/tests/lib/page-object/createCreatable.js b/ui-v2/tests/lib/page-object/createCreatable.js
new file mode 100644
index 0000000000..55504ea613
--- /dev/null
+++ b/ui-v2/tests/lib/page-object/createCreatable.js
@@ -0,0 +1,11 @@
+export default function(clickable, is) {
+ return function(obj) {
+ return {
+ ...obj,
+ ...{
+ create: clickable('[data-test-create]'),
+ createIsEnabled: is(':not(:disabled)', '[data-test-create]'),
+ },
+ };
+ };
+}
diff --git a/ui-v2/tests/pages.js b/ui-v2/tests/pages.js
index f72772b223..1922588f47 100644
--- a/ui-v2/tests/pages.js
+++ b/ui-v2/tests/pages.js
@@ -2,6 +2,7 @@ import { create, clickable, is, attribute, collection, text } from 'ember-cli-pa
import { visitable } from 'consul-ui/tests/lib/page-object/visitable';
import createDeletable from 'consul-ui/tests/lib/page-object/createDeletable';
import createSubmitable from 'consul-ui/tests/lib/page-object/createSubmitable';
+import createCreatable from 'consul-ui/tests/lib/page-object/createCreatable';
import page from 'consul-ui/tests/pages/components/page';
import radiogroup from 'consul-ui/tests/lib/page-object/radiogroup';
@@ -25,6 +26,7 @@ import intention from 'consul-ui/tests/pages/dc/intentions/edit';
const deletable = createDeletable(clickable);
const submitable = createSubmitable(clickable, is);
+const creatable = createCreatable(clickable, is);
export default {
index: create(index(visitable, collection)),
dcs: create(dcs(visitable, clickable, attribute, collection)),
@@ -32,12 +34,12 @@ export default {
service: create(service(visitable, attribute, collection, text, catalogFilter)),
nodes: create(nodes(visitable, clickable, attribute, collection, catalogFilter)),
node: create(node(visitable, deletable, clickable, attribute, collection, radiogroup)),
- kvs: create(kvs(visitable, deletable, clickable, attribute, collection)),
+ kvs: create(kvs(visitable, deletable, creatable, clickable, attribute, collection)),
kv: create(kv(visitable, submitable, deletable)),
- acls: create(acls(visitable, deletable, clickable, attribute, collection, aclFilter)),
+ acls: create(acls(visitable, deletable, creatable, clickable, attribute, collection, aclFilter)),
acl: create(acl(visitable, submitable, deletable, clickable)),
intentions: create(
- intentions(visitable, deletable, clickable, attribute, collection, intentionFilter)
+ intentions(visitable, deletable, creatable, clickable, attribute, collection, intentionFilter)
),
intention: create(intention(visitable, submitable, deletable)),
settings: create(settings(visitable, submitable)),
diff --git a/ui-v2/tests/pages/dc/acls/index.js b/ui-v2/tests/pages/dc/acls/index.js
index d96d935478..f8b6b53fad 100644
--- a/ui-v2/tests/pages/dc/acls/index.js
+++ b/ui-v2/tests/pages/dc/acls/index.js
@@ -1,5 +1,5 @@
-export default function(visitable, deletable, clickable, attribute, collection, filter) {
- return {
+export default function(visitable, deletable, creatable, clickable, attribute, collection, filter) {
+ return creatable({
visit: visitable('/:dc/acls'),
acls: collection(
'[data-test-tabular-row]',
@@ -12,5 +12,5 @@ export default function(visitable, deletable, clickable, attribute, collection,
})
),
filter: filter,
- };
+ });
}
diff --git a/ui-v2/tests/pages/dc/intentions/index.js b/ui-v2/tests/pages/dc/intentions/index.js
index 5ab14b01b0..5bd21010b5 100644
--- a/ui-v2/tests/pages/dc/intentions/index.js
+++ b/ui-v2/tests/pages/dc/intentions/index.js
@@ -1,5 +1,5 @@
-export default function(visitable, deletable, clickable, attribute, collection, filter) {
- return {
+export default function(visitable, deletable, creatable, clickable, attribute, collection, filter) {
+ return creatable({
visit: visitable('/:dc/intentions'),
intentions: collection(
'[data-test-tabular-row]',
@@ -15,5 +15,5 @@ export default function(visitable, deletable, clickable, attribute, collection,
})
),
filter: filter,
- };
+ });
}
diff --git a/ui-v2/tests/pages/dc/kv/index.js b/ui-v2/tests/pages/dc/kv/index.js
index a0c8439145..27c3dda55e 100644
--- a/ui-v2/tests/pages/dc/kv/index.js
+++ b/ui-v2/tests/pages/dc/kv/index.js
@@ -1,5 +1,5 @@
-export default function(visitable, deletable, clickable, attribute, collection) {
- return {
+export default function(visitable, deletable, creatable, clickable, attribute, collection) {
+ return creatable({
visit: visitable('/:dc/kv'),
kvs: collection(
'[data-test-tabular-row]',
@@ -9,5 +9,5 @@ export default function(visitable, deletable, clickable, attribute, collection)
actions: clickable('label'),
})
),
- };
+ });
}