From a6841881e3ed78be4b8114979465d5a93d806e4d Mon Sep 17 00:00:00 2001 From: cibernox Date: Thu, 29 Dec 2016 22:37:42 +0000 Subject: [PATCH 1/2] Remove deprecated Ember.K --- tests/unit/adapters/application-test.js | 4 ++-- tests/unit/mixins/resource-operations-test.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unit/adapters/application-test.js b/tests/unit/adapters/application-test.js index bd86674..8ece4fe 100644 --- a/tests/unit/adapters/application-test.js +++ b/tests/unit/adapters/application-test.js @@ -922,7 +922,7 @@ test('#fetch handles 204 (Success, no content) response status w/o calling deser sandbox.stub(adapter, 'fetchUrl', function () {}); mockFetchJax(sandbox, adapter, ''); sandbox.stub(adapter, 'cacheResource', function () {}); - adapter.serializer = {deserialize: sandbox.spy(), deserializeIncluded: Ember.K}; + adapter.serializer = {deserialize: sandbox.spy(), deserializeIncluded() {}}; let promise = adapter.fetch('/posts', {method: 'PATCH', body: '{"data": null}'}); assert.ok(typeof promise.then === 'function', 'returns a thenable'); @@ -940,7 +940,7 @@ test('#fetch handles 200 (Success) response status', function(assert) { const adapter = this.subject({type: 'posts', url: '/posts'}); mockFetchJax(sandbox, adapter, postMock); sandbox.stub(adapter, 'cacheResource', function () {}); - adapter.serializer = { deserialize: sandbox.spy(), deserializeIncluded: Ember.K }; + adapter.serializer = { deserialize: sandbox.spy(), deserializeIncluded() {} }; let promise = adapter.fetch('/posts/1', { method: 'GET' }); assert.ok(typeof promise.then === 'function', 'returns a thenable'); diff --git a/tests/unit/mixins/resource-operations-test.js b/tests/unit/mixins/resource-operations-test.js index 46f768e..db46221 100644 --- a/tests/unit/mixins/resource-operations-test.js +++ b/tests/unit/mixins/resource-operations-test.js @@ -20,12 +20,12 @@ module('Unit | Mixin | resource-operations', { createRelationship: this.sandbox.spy(promiseResolved), patchRelationship: this.sandbox.spy(promiseResolved), deleteRelationship: this.sandbox.spy(promiseResolved), - trigger: Ember.K + trigger() {} }, name: attr('string'), // mock relationship computed properties - guns: {kind: 'toMany', mapBy: Ember.K }, // toMany('guns') - horse: {kind: 'toOne', get: Ember.K } // toOne('horse') + guns: {kind: 'toMany', mapBy() {} }, // toMany('guns') + horse: {kind: 'toOne', get() {} } // toOne('horse') }); this.subject = Cowboy.create({ id: 1, name:'Lone Ranger'}); // mock payload setup From 5476b49eb11643f24f24d9a11c5b751251df99e1 Mon Sep 17 00:00:00 2001 From: Bill Heaton Date: Sat, 31 Dec 2016 00:30:28 -0800 Subject: [PATCH 2/2] Fixup! jshint error, unused Ember import in test --- tests/unit/mixins/resource-operations-test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit/mixins/resource-operations-test.js b/tests/unit/mixins/resource-operations-test.js index db46221..196e56a 100644 --- a/tests/unit/mixins/resource-operations-test.js +++ b/tests/unit/mixins/resource-operations-test.js @@ -1,4 +1,3 @@ -import Ember from 'ember'; import RSVP from 'rsvp'; // import ResourceOperationsMixin from 'ember-jsonapi-resources/mixins/resource-operations'; import { module, test } from 'qunit';