ui: Fix up peer ENT tests (#13633)

* ui: Add missing @nspaces

* Reorder peerings to be before any optionals

* Merge params instead of overwriting

* Reorder int tests
This commit is contained in:
John Cowen 2022-06-29 19:07:39 +01:00 committed by GitHub
parent 07bc22e405
commit d66f5a6364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 13 deletions

View File

@ -29,10 +29,10 @@ export default class NodeAdapter extends Adapter {
X-Request-ID: ${uri}
${{
...this.peeringQuery,
ns,
partition,
index,
...this.peeringQuery,
}}
`;
}

View File

@ -33,10 +33,10 @@ export default class ServiceAdapter extends Adapter {
X-Request-ID: ${uri}
${{
...this.peeringQuery,
ns,
partition,
index,
...this.peeringQuery,
}}
`;
}

View File

@ -301,11 +301,11 @@ export default class FSMWithOptionalLocation {
if (withOptional) {
const temp = url.split('/');
if (Object.keys(optional || {}).length === 0) {
optional = undefined;
}
optional = Object.values(optional || this.optional || {});
optional = optional.filter(item => Boolean(item)).map(item => item.value || item, []);
optional = {
...this.optional,
...(optional || {})
};
optional = Object.values(optional).filter(item => Boolean(item)).map(item => item.value || item, []);
temp.splice(...[1, 0].concat(optional));
url = temp.join('/');
}

View File

@ -45,7 +45,7 @@ Feature: dc / nodes / index
---
Then the url should be /dc-1/nodes
And the title should be "Nodes - Consul"
And a GET request was made to "/v1/internal/ui/nodes?dc=dc-1&with-peers=true"
And a GET request was made to "/v1/internal/ui/nodes?dc=dc-1&with-peers=true&ns=@namespace"
Then I see 3 node models
Scenario: Seeing the leader in node listing
Given 3 node models from yaml

View File

@ -16,7 +16,7 @@ Feature: dc / services / list
dc: dc-1
---
Then the url should be /dc-1/services
And a GET request was made to "/v1/internal/ui/services?dc=dc-1&with-peers=true"
And a GET request was made to "/v1/internal/ui/services?dc=dc-1&with-peers=true&ns=@namespace"
Then I see 3 service models

View File

@ -14,9 +14,9 @@ module('Integration | Adapter | node', function(hooks) {
const adapter = this.owner.lookup('adapter:node');
const client = this.owner.lookup('service:client/http');
const request = client.requestParams.bind(client);
const expected = `GET /v1/internal/ui/nodes?dc=${dc}${
const expected = `GET /v1/internal/ui/nodes?dc=${dc}&with-peers=true${
shouldHaveNspace(nspace) ? `&ns=${nspace}` : ``
}&with-peers=true`;
}`;
const actual = adapter.requestForQuery(request, {
dc: dc,
ns: nspace,

View File

@ -14,9 +14,9 @@ module('Integration | Adapter | service', function(hooks) {
const adapter = this.owner.lookup('adapter:service');
const client = this.owner.lookup('service:client/http');
const request = client.requestParams.bind(client);
const expected = `GET /v1/internal/ui/services?dc=${dc}${
const expected = `GET /v1/internal/ui/services?dc=${dc}&with-peers=true${
shouldHaveNspace(nspace) ? `&ns=${nspace}` : ``
}&with-peers=true`;
}`;
let actual = adapter.requestForQuery(request, {
dc: dc,
ns: nspace,