mirror of https://github.com/status-im/consul.git
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:
parent
07bc22e405
commit
d66f5a6364
|
@ -29,10 +29,10 @@ export default class NodeAdapter extends Adapter {
|
|||
X-Request-ID: ${uri}
|
||||
|
||||
${{
|
||||
...this.peeringQuery,
|
||||
ns,
|
||||
partition,
|
||||
index,
|
||||
...this.peeringQuery,
|
||||
}}
|
||||
`;
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ export default class ServiceAdapter extends Adapter {
|
|||
X-Request-ID: ${uri}
|
||||
|
||||
${{
|
||||
...this.peeringQuery,
|
||||
ns,
|
||||
partition,
|
||||
index,
|
||||
...this.peeringQuery,
|
||||
}}
|
||||
`;
|
||||
}
|
||||
|
|
|
@ -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('/');
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue