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 15473db84f
commit 4f34ac7861
8 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
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) {
setupTest(hooks);
const dc = 'dc-1';
@ -29,6 +30,7 @@ module('Integration | Adapter | acl | response', function(hooks) {
return get(request.url).then(function(payload) {
const expected = Object.assign({}, payload[0], {
Datacenter: dc,
[META]: {},
uid: `["${dc}","${id}"]`,
});
const actual = adapter.handleResponse(200, {}, payload, request);

View File

@ -1,6 +1,7 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
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) {
setupTest(hooks);
const dc = 'dc-1';
@ -31,6 +32,7 @@ module('Integration | Adapter | intention | response', function(hooks) {
return get(request.url).then(function(payload) {
const expected = Object.assign({}, payload, {
Datacenter: dc,
[META]: {},
uid: `["${dc}","${id}"]`,
});
const actual = adapter.handleResponse(200, {}, payload, request);

View File

@ -1,6 +1,7 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
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) {
setupTest(hooks);
const dc = 'dc-1';
@ -35,6 +36,7 @@ module('Integration | Adapter | kv | response', function(hooks) {
return get(request.url).then(function(payload) {
const expected = Object.assign({}, payload[0], {
Datacenter: dc,
[META]: {},
uid: `["${dc}","${id}"]`,
});
const actual = adapter.handleResponse(200, {}, payload, request);

View File

@ -1,6 +1,7 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
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) {
setupTest(hooks);
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) {
const expected = Object.assign({}, payload, {
Datacenter: dc,
[META]: {},
uid: `["${dc}","${id}"]`,
});
const actual = adapter.handleResponse(200, {}, payload, request);

View File

@ -1,6 +1,7 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
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) {
setupTest(hooks);
const dc = 'dc-1';
@ -29,6 +30,7 @@ module('Integration | Adapter | policy | response', function(hooks) {
return get(request.url).then(function(payload) {
const expected = Object.assign({}, payload, {
Datacenter: dc,
[META]: {},
uid: `["${dc}","${id}"]`,
});
const actual = adapter.handleResponse(200, {}, payload, request);

View File

@ -1,6 +1,7 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
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) {
setupTest(hooks);
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) {
const expected = {
Datacenter: dc,
[META]: {},
uid: `["${dc}","${id}"]`,
Nodes: payload,
};

View File

@ -1,6 +1,7 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
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) {
setupTest(hooks);
const dc = 'dc-1';
@ -30,6 +31,7 @@ module('Integration | Adapter | session | response', function(hooks) {
return get(request.url).then(function(payload) {
const expected = Object.assign({}, payload[0], {
Datacenter: dc,
[META]: {},
uid: `["${dc}","${id}"]`,
});
const actual = adapter.handleResponse(200, {}, payload, request);

View File

@ -1,6 +1,7 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
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) {
setupTest(hooks);
const dc = 'dc-1';
@ -29,6 +30,7 @@ module('Integration | Adapter | token | response', function(hooks) {
return get(request.url).then(function(payload) {
const expected = Object.assign({}, payload, {
Datacenter: dc,
[META]: {},
uid: `["${dc}","${id}"]`,
});
const actual = adapter.handleResponse(200, {}, payload, request);