mirror of https://github.com/status-im/consul.git
ui: Fixup tests to expect the new `meta` property on listings (#4990)
This commit is contained in:
parent
f7d2651ac3
commit
7dc7d325dc
|
@ -1,6 +1,7 @@
|
||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
import { get } from 'consul-ui/tests/helpers/api';
|
import { get } from 'consul-ui/tests/helpers/api';
|
||||||
|
import { HEADERS_SYMBOL as META } from 'consul-ui/utils/http/consul';
|
||||||
module('Integration | Adapter | acl | response', function(hooks) {
|
module('Integration | Adapter | acl | response', function(hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
const dc = 'dc-1';
|
const dc = 'dc-1';
|
||||||
|
@ -29,6 +30,7 @@ module('Integration | Adapter | acl | response', function(hooks) {
|
||||||
return get(request.url).then(function(payload) {
|
return get(request.url).then(function(payload) {
|
||||||
const expected = Object.assign({}, payload[0], {
|
const expected = Object.assign({}, payload[0], {
|
||||||
Datacenter: dc,
|
Datacenter: dc,
|
||||||
|
[META]: {},
|
||||||
uid: `["${dc}","${id}"]`,
|
uid: `["${dc}","${id}"]`,
|
||||||
});
|
});
|
||||||
const actual = adapter.handleResponse(200, {}, payload, request);
|
const actual = adapter.handleResponse(200, {}, payload, request);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
import { get } from 'consul-ui/tests/helpers/api';
|
import { get } from 'consul-ui/tests/helpers/api';
|
||||||
|
import { HEADERS_SYMBOL as META } from 'consul-ui/utils/http/consul';
|
||||||
module('Integration | Adapter | intention | response', function(hooks) {
|
module('Integration | Adapter | intention | response', function(hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
const dc = 'dc-1';
|
const dc = 'dc-1';
|
||||||
|
@ -31,6 +32,7 @@ module('Integration | Adapter | intention | response', function(hooks) {
|
||||||
return get(request.url).then(function(payload) {
|
return get(request.url).then(function(payload) {
|
||||||
const expected = Object.assign({}, payload, {
|
const expected = Object.assign({}, payload, {
|
||||||
Datacenter: dc,
|
Datacenter: dc,
|
||||||
|
[META]: {},
|
||||||
uid: `["${dc}","${id}"]`,
|
uid: `["${dc}","${id}"]`,
|
||||||
});
|
});
|
||||||
const actual = adapter.handleResponse(200, {}, payload, request);
|
const actual = adapter.handleResponse(200, {}, payload, request);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
import { get } from 'consul-ui/tests/helpers/api';
|
import { get } from 'consul-ui/tests/helpers/api';
|
||||||
|
import { HEADERS_SYMBOL as META } from 'consul-ui/utils/http/consul';
|
||||||
module('Integration | Adapter | kv | response', function(hooks) {
|
module('Integration | Adapter | kv | response', function(hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
const dc = 'dc-1';
|
const dc = 'dc-1';
|
||||||
|
@ -35,6 +36,7 @@ module('Integration | Adapter | kv | response', function(hooks) {
|
||||||
return get(request.url).then(function(payload) {
|
return get(request.url).then(function(payload) {
|
||||||
const expected = Object.assign({}, payload[0], {
|
const expected = Object.assign({}, payload[0], {
|
||||||
Datacenter: dc,
|
Datacenter: dc,
|
||||||
|
[META]: {},
|
||||||
uid: `["${dc}","${id}"]`,
|
uid: `["${dc}","${id}"]`,
|
||||||
});
|
});
|
||||||
const actual = adapter.handleResponse(200, {}, payload, request);
|
const actual = adapter.handleResponse(200, {}, payload, request);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
import { get } from 'consul-ui/tests/helpers/api';
|
import { get } from 'consul-ui/tests/helpers/api';
|
||||||
|
import { HEADERS_SYMBOL as META } from 'consul-ui/utils/http/consul';
|
||||||
module('Integration | Adapter | node | response', function(hooks) {
|
module('Integration | Adapter | node | response', function(hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
test('handleResponse returns the correct data for list endpoint', function(assert) {
|
test('handleResponse returns the correct data for list endpoint', function(assert) {
|
||||||
|
@ -30,6 +31,7 @@ module('Integration | Adapter | node | response', function(hooks) {
|
||||||
return get(request.url).then(function(payload) {
|
return get(request.url).then(function(payload) {
|
||||||
const expected = Object.assign({}, payload, {
|
const expected = Object.assign({}, payload, {
|
||||||
Datacenter: dc,
|
Datacenter: dc,
|
||||||
|
[META]: {},
|
||||||
uid: `["${dc}","${id}"]`,
|
uid: `["${dc}","${id}"]`,
|
||||||
});
|
});
|
||||||
const actual = adapter.handleResponse(200, {}, payload, request);
|
const actual = adapter.handleResponse(200, {}, payload, request);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
import { get } from 'consul-ui/tests/helpers/api';
|
import { get } from 'consul-ui/tests/helpers/api';
|
||||||
|
import { HEADERS_SYMBOL as META } from 'consul-ui/utils/http/consul';
|
||||||
module('Integration | Adapter | policy | response', function(hooks) {
|
module('Integration | Adapter | policy | response', function(hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
const dc = 'dc-1';
|
const dc = 'dc-1';
|
||||||
|
@ -29,6 +30,7 @@ module('Integration | Adapter | policy | response', function(hooks) {
|
||||||
return get(request.url).then(function(payload) {
|
return get(request.url).then(function(payload) {
|
||||||
const expected = Object.assign({}, payload, {
|
const expected = Object.assign({}, payload, {
|
||||||
Datacenter: dc,
|
Datacenter: dc,
|
||||||
|
[META]: {},
|
||||||
uid: `["${dc}","${id}"]`,
|
uid: `["${dc}","${id}"]`,
|
||||||
});
|
});
|
||||||
const actual = adapter.handleResponse(200, {}, payload, request);
|
const actual = adapter.handleResponse(200, {}, payload, request);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
import { get } from 'consul-ui/tests/helpers/api';
|
import { get } from 'consul-ui/tests/helpers/api';
|
||||||
|
import { HEADERS_SYMBOL as META } from 'consul-ui/utils/http/consul';
|
||||||
module('Integration | Adapter | service | response', function(hooks) {
|
module('Integration | Adapter | service | response', function(hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
test('handleResponse returns the correct data for list endpoint', function(assert) {
|
test('handleResponse returns the correct data for list endpoint', function(assert) {
|
||||||
|
@ -30,6 +31,7 @@ module('Integration | Adapter | service | response', function(hooks) {
|
||||||
return get(request.url).then(function(payload) {
|
return get(request.url).then(function(payload) {
|
||||||
const expected = {
|
const expected = {
|
||||||
Datacenter: dc,
|
Datacenter: dc,
|
||||||
|
[META]: {},
|
||||||
uid: `["${dc}","${id}"]`,
|
uid: `["${dc}","${id}"]`,
|
||||||
Nodes: payload,
|
Nodes: payload,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
import { get } from 'consul-ui/tests/helpers/api';
|
import { get } from 'consul-ui/tests/helpers/api';
|
||||||
|
import { HEADERS_SYMBOL as META } from 'consul-ui/utils/http/consul';
|
||||||
module('Integration | Adapter | session | response', function(hooks) {
|
module('Integration | Adapter | session | response', function(hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
const dc = 'dc-1';
|
const dc = 'dc-1';
|
||||||
|
@ -30,6 +31,7 @@ module('Integration | Adapter | session | response', function(hooks) {
|
||||||
return get(request.url).then(function(payload) {
|
return get(request.url).then(function(payload) {
|
||||||
const expected = Object.assign({}, payload[0], {
|
const expected = Object.assign({}, payload[0], {
|
||||||
Datacenter: dc,
|
Datacenter: dc,
|
||||||
|
[META]: {},
|
||||||
uid: `["${dc}","${id}"]`,
|
uid: `["${dc}","${id}"]`,
|
||||||
});
|
});
|
||||||
const actual = adapter.handleResponse(200, {}, payload, request);
|
const actual = adapter.handleResponse(200, {}, payload, request);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
import { get } from 'consul-ui/tests/helpers/api';
|
import { get } from 'consul-ui/tests/helpers/api';
|
||||||
|
import { HEADERS_SYMBOL as META } from 'consul-ui/utils/http/consul';
|
||||||
module('Integration | Adapter | token | response', function(hooks) {
|
module('Integration | Adapter | token | response', function(hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
const dc = 'dc-1';
|
const dc = 'dc-1';
|
||||||
|
@ -29,6 +30,7 @@ module('Integration | Adapter | token | response', function(hooks) {
|
||||||
return get(request.url).then(function(payload) {
|
return get(request.url).then(function(payload) {
|
||||||
const expected = Object.assign({}, payload, {
|
const expected = Object.assign({}, payload, {
|
||||||
Datacenter: dc,
|
Datacenter: dc,
|
||||||
|
[META]: {},
|
||||||
uid: `["${dc}","${id}"]`,
|
uid: `["${dc}","${id}"]`,
|
||||||
});
|
});
|
||||||
const actual = adapter.handleResponse(200, {}, payload, request);
|
const actual = adapter.handleResponse(200, {}, payload, request);
|
||||||
|
|
Loading…
Reference in New Issue