From 4f34ac78611096e47a8891bc60533a1448e432f0 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Mon, 26 Nov 2018 14:29:48 +0000 Subject: [PATCH] ui: Fixup tests to expect the new `meta` property on listings (#4990) --- ui-v2/tests/integration/adapters/acl/response-test.js | 2 ++ ui-v2/tests/integration/adapters/intention/response-test.js | 2 ++ ui-v2/tests/integration/adapters/kv/response-test.js | 2 ++ ui-v2/tests/integration/adapters/node/response-test.js | 2 ++ ui-v2/tests/integration/adapters/policy/response-test.js | 2 ++ ui-v2/tests/integration/adapters/service/response-test.js | 2 ++ ui-v2/tests/integration/adapters/session/response-test.js | 2 ++ ui-v2/tests/integration/adapters/token/response-test.js | 2 ++ 8 files changed, 16 insertions(+) diff --git a/ui-v2/tests/integration/adapters/acl/response-test.js b/ui-v2/tests/integration/adapters/acl/response-test.js index f1dc795aa..5da7808da 100644 --- a/ui-v2/tests/integration/adapters/acl/response-test.js +++ b/ui-v2/tests/integration/adapters/acl/response-test.js @@ -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); diff --git a/ui-v2/tests/integration/adapters/intention/response-test.js b/ui-v2/tests/integration/adapters/intention/response-test.js index 48944273a..62c583cb6 100644 --- a/ui-v2/tests/integration/adapters/intention/response-test.js +++ b/ui-v2/tests/integration/adapters/intention/response-test.js @@ -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); diff --git a/ui-v2/tests/integration/adapters/kv/response-test.js b/ui-v2/tests/integration/adapters/kv/response-test.js index 8b5dd8e72..db6e5def7 100644 --- a/ui-v2/tests/integration/adapters/kv/response-test.js +++ b/ui-v2/tests/integration/adapters/kv/response-test.js @@ -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); diff --git a/ui-v2/tests/integration/adapters/node/response-test.js b/ui-v2/tests/integration/adapters/node/response-test.js index dcddc2359..c3a3ebf49 100644 --- a/ui-v2/tests/integration/adapters/node/response-test.js +++ b/ui-v2/tests/integration/adapters/node/response-test.js @@ -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); diff --git a/ui-v2/tests/integration/adapters/policy/response-test.js b/ui-v2/tests/integration/adapters/policy/response-test.js index dc90fa107..03ef04ea0 100644 --- a/ui-v2/tests/integration/adapters/policy/response-test.js +++ b/ui-v2/tests/integration/adapters/policy/response-test.js @@ -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); diff --git a/ui-v2/tests/integration/adapters/service/response-test.js b/ui-v2/tests/integration/adapters/service/response-test.js index a9641b668..827dc5c72 100644 --- a/ui-v2/tests/integration/adapters/service/response-test.js +++ b/ui-v2/tests/integration/adapters/service/response-test.js @@ -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, }; diff --git a/ui-v2/tests/integration/adapters/session/response-test.js b/ui-v2/tests/integration/adapters/session/response-test.js index 9af7fde38..9626bc551 100644 --- a/ui-v2/tests/integration/adapters/session/response-test.js +++ b/ui-v2/tests/integration/adapters/session/response-test.js @@ -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); diff --git a/ui-v2/tests/integration/adapters/token/response-test.js b/ui-v2/tests/integration/adapters/token/response-test.js index 0a60965b8..573ef05b5 100644 --- a/ui-v2/tests/integration/adapters/token/response-test.js +++ b/ui-v2/tests/integration/adapters/token/response-test.js @@ -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);