mirror of https://github.com/hashicorp/consul
Merge pull request #4251 from hashicorp/bugfix/ui-null-tokens
Ensure a blank/empty token is sent if the localStorage kv doesn't existpull/4252/head^2
commit
b41d19c3c0
@ -0,0 +1,15 @@
|
||||
@setupApplicationTest
|
||||
Feature: settings / update: Update Settings
|
||||
In order to authenticate with an ACL token
|
||||
As a user
|
||||
I need to be able to add my token via the UI
|
||||
Scenario: I click Save without actually typing anything
|
||||
Given 1 datacenter model with the value "datacenter"
|
||||
When I visit the settings page
|
||||
Then the url should be /settings
|
||||
And I submit
|
||||
Then I have settings like yaml
|
||||
---
|
||||
token: ''
|
||||
---
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
@ -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);
|
||||
});
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
@setupApplicationTest
|
||||
Feature: token headers
|
||||
In order to authenticate with tokens
|
||||
As a user
|
||||
I need to be able to specify a ACL token AND/OR leave it blank to authenticate with the API
|
||||
Scenario: Arriving at the index page having not set a token previously
|
||||
Given 1 datacenter model with the value "datacenter"
|
||||
When I visit the index page
|
||||
Then the url should be /datacenter/services
|
||||
And a GET request is made to "/v1/catalog/datacenters" from yaml
|
||||
---
|
||||
headers:
|
||||
X-Consul-Token: ''
|
||||
---
|
||||
Scenario: Set the token to [Token] and then navigate to the index page
|
||||
Given 1 datacenter model with the value "datacenter"
|
||||
When I visit the settings page
|
||||
Then the url should be /settings
|
||||
Then I type with yaml
|
||||
---
|
||||
token: [Token]
|
||||
---
|
||||
And I submit
|
||||
When I visit the index page
|
||||
Then the url should be /datacenter/services
|
||||
And a GET request is made to "/v1/catalog/datacenters" from yaml
|
||||
---
|
||||
headers:
|
||||
X-Consul-Token: [Token]
|
||||
---
|
||||
Where:
|
||||
---------
|
||||
| Token |
|
||||
| token |
|
||||
| '' |
|
||||
---------
|
@ -0,0 +1,6 @@
|
||||
import { create, visitable, clickable } from 'ember-cli-page-object';
|
||||
|
||||
export default create({
|
||||
visit: visitable('/settings'),
|
||||
submit: clickable('[type=submit]'),
|
||||
});
|
Loading…
Reference in new issue