Skip to content

Commit

Permalink
[CHORE]: Modernize Handle-Response-Test (#7622)
Browse files Browse the repository at this point in the history
* .equal()->strictEqual()

* stringify ids and http status codes
  • Loading branch information
runnerboy22 authored Apr 15, 2022
1 parent 696c253 commit e3edf87
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ module('integration/adapter/handle-response', function (hooks) {
let samplePayload = {
data: [
{
id: 1,
id: '1',
type: 'person',
attributes: {
name: 'John Smith',
},
},
{
id: 2,
id: '2',
type: 'person',
attributes: {
name: 'Zhang San',
Expand All @@ -51,7 +51,7 @@ module('integration/adapter/handle-response', function (hooks) {
};

this.server.get('/people', function () {
return [200, { 'Content-Type': 'application/json' }, JSON.stringify(samplePayload)];
return ['200', { 'Content-Type': 'application/json' }, JSON.stringify(samplePayload)];
});

class TestAdapter extends JSONAPIAdapter {
Expand All @@ -77,7 +77,7 @@ module('integration/adapter/handle-response', function (hooks) {
};

this.server.get('/people', function () {
return [200, { 'Content-Type': 'application/json' }, JSON.stringify(samplePayload)];
return ['200', { 'Content-Type': 'application/json' }, JSON.stringify(samplePayload)];
});

class TestAdapter extends JSONAPIAdapter {
Expand All @@ -99,7 +99,7 @@ module('integration/adapter/handle-response', function (hooks) {
let handleResponseCalled = 0;

this.server.get('/people', function () {
return [200, { 'Content-Type': 'application/json' }, ''];
return ['200', { 'Content-Type': 'application/json' }, ''];
});

class TestAdapter extends JSONAPIAdapter {
Expand All @@ -126,7 +126,7 @@ module('integration/adapter/handle-response', function (hooks) {
let handleResponseCalled = 0;

this.server.get('/people', function () {
return [200, { 'Content-Type': 'application/json' }, 'bogus response'];
return ['200', { 'Content-Type': 'application/json' }, 'bogus response'];
});

class TestAdapter extends JSONAPIAdapter {
Expand All @@ -153,7 +153,7 @@ module('integration/adapter/handle-response', function (hooks) {
let handleResponseCalled = 0;

this.server.get('/people', function () {
return [400, { 'Content-Type': 'application/json' }, ''];
return ['400', { 'Content-Type': 'application/json' }, ''];
});

class TestAdapter extends JSONAPIAdapter {
Expand Down Expand Up @@ -182,7 +182,7 @@ module('integration/adapter/handle-response', function (hooks) {
let errorObject = { errors: {} };

this.server.get('/people', function () {
return [422, { 'Content-Type': 'application/json' }, JSON.stringify(errorObject)];
return ['422', { 'Content-Type': 'application/json' }, JSON.stringify(errorObject)];
});

class TestAdapter extends JSONAPIAdapter {
Expand Down

0 comments on commit e3edf87

Please sign in to comment.