John Cowen b256313256
ui: [BUGFIX] Ensure in-folder KVs are created in the correct folder (#10569)
When clicking to create a KV within folder name, would would be viewing a form that was a form for creating a KV in the root, which when the user clicked to save, saved the KV in the root.

For the moment at least I've removed the code that strips double slashes, and whilst this isn't ideal, it looks like we've picked up one of those bugs that turns into a 'feature', and completely reworking KV to not rely on the double slashes is not really an option right now.
2021-07-14 18:49:01 +01:00

52 lines
1.7 KiB
Gherkin

@setupApplicationTest
Feature: dc / kvs / create
Scenario: Creating a root KV
Given 1 datacenter model with the value "datacenter"
When I visit the kv page for yaml
---
dc: datacenter
---
Then the url should be /datacenter/kv/create
And the title should be "New Key/Value - Consul"
Then I fill in with yaml
---
additional: key-value
value: value
---
And I submit
Then the url should be /datacenter/kv
Then a PUT request was made to "/v1/kv/key-value?dc=datacenter&ns=@namespace"
And "[data-notification]" has the "notification-update" class
And "[data-notification]" has the "success" class
Scenario: Creating a folder
Given 1 datacenter model with the value "datacenter"
When I visit the kv page for yaml
---
dc: datacenter
---
Then the url should be /datacenter/kv/create
And the title should be "New Key/Value - Consul"
Then I fill in with yaml
---
additional: key-value/
---
And I submit
Then the url should be /datacenter/kv
Then a PUT request was made to "/v1/kv/key-value/?dc=datacenter&ns=@namespace"
And "[data-notification]" has the "notification-update" class
And "[data-notification]" has the "success" class
Scenario: Clicking create from within a folder
Given 1 datacenter model with the value "datacenter"
And 1 kv model from yaml
---
- key-value/
---
When I visit the kvs page for yaml
---
dc: datacenter
---
And I click kv on the kvs
And I click create
And I see the text "New Key / Value" in "h1"
And I see the text "key-value" in "[data-test-breadcrumbs] li:nth-child(2) a"