diff --git a/ui-v2/app/components/toggle-button.js b/ui-v2/app/components/toggle-button.js
index 7dd4ed7f9fac..9ca93680d6bb 100644
--- a/ui-v2/app/components/toggle-button.js
+++ b/ui-v2/app/components/toggle-button.js
@@ -6,7 +6,9 @@ export default Component.extend({
dom: service('dom'),
// TODO(octane): Remove when we can move to glimmer components
// so we aren't using ember-test-selectors
- supportsDataTestProperties: true,
+ // supportsDataTestProperties: true,
+ // the above doesn't seem to do anything so still need to find a way
+ // to pass through data-test-properties
tagName: '',
// TODO: reserved for the moment but we don't need it yet
onblur: null,
diff --git a/ui-v2/app/templates/components/hashicorp-consul.hbs b/ui-v2/app/templates/components/hashicorp-consul.hbs
index 26f54f61e8f9..6153a9953fd1 100644
--- a/ui-v2/app/templates/components/hashicorp-consul.hbs
+++ b/ui-v2/app/templates/components/hashicorp-consul.hbs
@@ -12,11 +12,13 @@
{{#if dc}}
{{#if (env 'CONSUL_NSPACES_ENABLED')}}
+{{!FIXME only show this if I'm allowed to see it right now we can only be sure you are allowed to see this if ACLs are disabled until we have further API support}}
+{{#let (or canManageNamespaces (not (env 'CONSUL_ACLS_ENABLED'))) as |nspaceManagement|}}
@@ -33,8 +35,7 @@
{{item.Name}}
{{/each}}
- {{!FIXME only show this if I'm allowed to see it right now we can only be sure you are allowed to see this if ACLs are disabled until we have further API support}}
- {{#if (not (env 'CONSUL_ACLS_ENABLED')) }}
+ {{#if nspaceManagement }}
diff --git a/ui-v2/app/templates/components/toggle-button.hbs b/ui-v2/app/templates/components/toggle-button.hbs
index d3d9e9650e94..d318c32840aa 100644
--- a/ui-v2/app/templates/components/toggle-button.hbs
+++ b/ui-v2/app/templates/components/toggle-button.hbs
@@ -1,2 +1,2 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ui-v2/tests/acceptance/dc/acls/tokens/login.feature b/ui-v2/tests/acceptance/dc/acls/tokens/login.feature
index 471e08a34e6d..76c1cf3a6104 100644
--- a/ui-v2/tests/acceptance/dc/acls/tokens/login.feature
+++ b/ui-v2/tests/acceptance/dc/acls/tokens/login.feature
@@ -13,7 +13,7 @@ Feature: dc / acls / tokens / login
secret: something
---
And I submit
- Then a GET request is made to "/v1/acl/token/self?dc=dc-1" from yaml
+ Then a GET request was made to "/v1/acl/token/self?dc=dc-1" from yaml
---
headers:
X-Consul-Token: something
diff --git a/ui-v2/tests/acceptance/dc/services/error.feature b/ui-v2/tests/acceptance/dc/services/error.feature
index 020dc833e8f8..0252b9a1188e 100644
--- a/ui-v2/tests/acceptance/dc/services/error.feature
+++ b/ui-v2/tests/acceptance/dc/services/error.feature
@@ -23,5 +23,5 @@ Feature: dc / services / error
dc: dc-1
---
Then I see the text "500 (The backend responded with an error)" in "[data-test-error]"
- And I click "[data-test-toggle-button='datacenters']"
+ When I click dc on the navigation
And I see 2 datacenter models
diff --git a/ui-v2/tests/integration/serializers/session-test.js b/ui-v2/tests/integration/serializers/session-test.js
index 390819b8afb5..e68f32344eff 100644
--- a/ui-v2/tests/integration/serializers/session-test.js
+++ b/ui-v2/tests/integration/serializers/session-test.js
@@ -1,8 +1,12 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { get } from 'consul-ui/tests/helpers/api';
-import { HEADERS_SYMBOL as META, HEADERS_DATACENTER as DC } from 'consul-ui/utils/http/consul';
-module('Integration | Adapter | session | response', function(hooks) {
+import {
+ HEADERS_SYMBOL as META,
+ HEADERS_DATACENTER as DC,
+ HEADERS_NAMESPACE as NSPACE,
+} from 'consul-ui/utils/http/consul';
+module('Integration | Serializer | session | response', function(hooks) {
setupTest(hooks);
const dc = 'dc-1';
const id = 'session-id';
@@ -50,6 +54,7 @@ module('Integration | Adapter | session | response', function(hooks) {
Datacenter: dc,
[META]: {
[DC.toLowerCase()]: dc,
+ [NSPACE.toLowerCase()]: payload[0].Namespace || undefinedNspace,
},
Namespace: payload[0].Namespace || undefinedNspace,
uid: `["${payload[0].Namespace || undefinedNspace}","${dc}","${id}"]`,
diff --git a/ui-v2/tests/integration/services/repository/node-test.js b/ui-v2/tests/integration/services/repository/node-test.js
index ba0b8e6734b7..e2a9895eda30 100644
--- a/ui-v2/tests/integration/services/repository/node-test.js
+++ b/ui-v2/tests/integration/services/repository/node-test.js
@@ -65,6 +65,7 @@ test('findBySlug returns the correct data for item endpoint', function(assert) {
meta: {
cursor: undefined,
dc: dc,
+ nspace: nspace,
},
});
})
diff --git a/ui-v2/tests/integration/services/repository/service-test.js b/ui-v2/tests/integration/services/repository/service-test.js
index 3f63225c9cbb..30937189af0e 100644
--- a/ui-v2/tests/integration/services/repository/service-test.js
+++ b/ui-v2/tests/integration/services/repository/service-test.js
@@ -92,6 +92,7 @@ const undefinedNspace = 'default';
service.meta = {
cursor: undefined,
dc: dc,
+ nspace: payload.Namespace,
};
return service;
diff --git a/ui-v2/tests/steps/assertions/http.js b/ui-v2/tests/steps/assertions/http.js
index 63a530885e8e..a3c0b58c4fb6 100644
--- a/ui-v2/tests/steps/assertions/http.js
+++ b/ui-v2/tests/steps/assertions/http.js
@@ -1,3 +1,7 @@
+// TODO: This entire file/steps need refactoring out so that they don't depend on order
+// unless you specifically ask it to assert for order of requests
+// this should also let us simplify the entire API for these steps
+// an reword them to make more sense
export default function(scenario, assert, lastNthRequest) {
// lastNthRequest should return a
// {
@@ -122,5 +126,29 @@ export default function(scenario, assert, lastNthRequest) {
})
);
assert.equal(diff.size, 0, `Expected requests "${[...diff].join(', ')}"`);
+ })
+ .then('a $method request was made to "$url" from yaml\n$yaml', function(method, url, yaml) {
+ const requests = lastNthRequest(null, method);
+ const request = requests.find(function(item) {
+ return method === item.method && url === item.url;
+ });
+ let data = yaml.body || {};
+ const body = JSON.parse(request.requestBody);
+ Object.keys(data).forEach(function(key, i, arr) {
+ assert.equal(
+ body[key],
+ data[key],
+ `Expected the payload to contain ${key} to equal ${body[key]}, ${key} was ${data[key]}`
+ );
+ });
+ data = yaml.headers || {};
+ const headers = request.requestHeaders;
+ Object.keys(data).forEach(function(key, i, arr) {
+ assert.equal(
+ headers[key],
+ data[key],
+ `Expected the payload to contain ${key} to equal ${headers[key]}, ${key} was ${data[key]}`
+ );
+ });
});
}