ui: Fixup tests to expect the new `meta` property on listings (#4990)

This commit is contained in:
John Cowen 2018-11-26 14:29:48 +00:00 committed by John Cowen
parent f7d2651ac3
commit 7dc7d325dc
8 changed files with 16 additions and 0 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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,
}; };

View File

@ -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);

View File

@ -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);