mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 21:35:52 +00:00
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}
|
X-Request-ID: ${uri}
|
||||||
|
|
||||||
${{
|
${{
|
||||||
|
...this.peeringQuery,
|
||||||
ns,
|
ns,
|
||||||
partition,
|
partition,
|
||||||
index,
|
index,
|
||||||
...this.peeringQuery,
|
|
||||||
}}
|
}}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -33,10 +33,10 @@ export default class ServiceAdapter extends Adapter {
|
|||||||
X-Request-ID: ${uri}
|
X-Request-ID: ${uri}
|
||||||
|
|
||||||
${{
|
${{
|
||||||
|
...this.peeringQuery,
|
||||||
ns,
|
ns,
|
||||||
partition,
|
partition,
|
||||||
index,
|
index,
|
||||||
...this.peeringQuery,
|
|
||||||
}}
|
}}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -301,11 +301,11 @@ export default class FSMWithOptionalLocation {
|
|||||||
|
|
||||||
if (withOptional) {
|
if (withOptional) {
|
||||||
const temp = url.split('/');
|
const temp = url.split('/');
|
||||||
if (Object.keys(optional || {}).length === 0) {
|
optional = {
|
||||||
optional = undefined;
|
...this.optional,
|
||||||
}
|
...(optional || {})
|
||||||
optional = Object.values(optional || this.optional || {});
|
};
|
||||||
optional = optional.filter(item => Boolean(item)).map(item => item.value || item, []);
|
optional = Object.values(optional).filter(item => Boolean(item)).map(item => item.value || item, []);
|
||||||
temp.splice(...[1, 0].concat(optional));
|
temp.splice(...[1, 0].concat(optional));
|
||||||
url = temp.join('/');
|
url = temp.join('/');
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ Feature: dc / nodes / index
|
|||||||
---
|
---
|
||||||
Then the url should be /dc-1/nodes
|
Then the url should be /dc-1/nodes
|
||||||
And the title should be "Nodes - Consul"
|
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
|
Then I see 3 node models
|
||||||
Scenario: Seeing the leader in node listing
|
Scenario: Seeing the leader in node listing
|
||||||
Given 3 node models from yaml
|
Given 3 node models from yaml
|
||||||
|
@ -16,7 +16,7 @@ Feature: dc / services / list
|
|||||||
dc: dc-1
|
dc: dc-1
|
||||||
---
|
---
|
||||||
Then the url should be /dc-1/services
|
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
|
Then I see 3 service models
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@ module('Integration | Adapter | node', function(hooks) {
|
|||||||
const adapter = this.owner.lookup('adapter:node');
|
const adapter = this.owner.lookup('adapter:node');
|
||||||
const client = this.owner.lookup('service:client/http');
|
const client = this.owner.lookup('service:client/http');
|
||||||
const request = client.requestParams.bind(client);
|
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}` : ``
|
shouldHaveNspace(nspace) ? `&ns=${nspace}` : ``
|
||||||
}&with-peers=true`;
|
}`;
|
||||||
const actual = adapter.requestForQuery(request, {
|
const actual = adapter.requestForQuery(request, {
|
||||||
dc: dc,
|
dc: dc,
|
||||||
ns: nspace,
|
ns: nspace,
|
||||||
|
@ -14,9 +14,9 @@ module('Integration | Adapter | service', function(hooks) {
|
|||||||
const adapter = this.owner.lookup('adapter:service');
|
const adapter = this.owner.lookup('adapter:service');
|
||||||
const client = this.owner.lookup('service:client/http');
|
const client = this.owner.lookup('service:client/http');
|
||||||
const request = client.requestParams.bind(client);
|
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}` : ``
|
shouldHaveNspace(nspace) ? `&ns=${nspace}` : ``
|
||||||
}&with-peers=true`;
|
}`;
|
||||||
let actual = adapter.requestForQuery(request, {
|
let actual = adapter.requestForQuery(request, {
|
||||||
dc: dc,
|
dc: dc,
|
||||||
ns: nspace,
|
ns: nspace,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user