Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Comments

Oddly broken test.#93

Closed
aars wants to merge 1 commit intopixelhandler:masterfrom
realxsnl:odd-test-failure
Closed

Oddly broken test.#93
aars wants to merge 1 commit intopixelhandler:masterfrom
realxsnl:odd-test-failure

Conversation

@aars
Copy link
Collaborator

@aars aars commented Aug 29, 2016

This one test is broken in an unapparent fashion (for me at least).

This is the only test that breaks after I added my "cast id to string" code. Oddly enough it doesn't have much to do with my changes though, as presented here (cloned from master).

Simply changing the ids to strings (what they MUST be according to JSONAPI) somehow ends up calling addRelationship on the resource, and then it breaks.

Also, minor and very unrelated issue in payload, the name property should be part of attributes.

type: 'supervisors',
id: 1000000,
id: '1000000',
name: 'The Boss',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in key attributes.

@aars
Copy link
Collaborator Author

aars commented Aug 29, 2016

Uncaught TypeError: Cannot read property 'cacheLookup' of undefined(…)
addRelationship @ resource.js:181
_updateRelationshipsData @ resource.js:123
didResolveProxyRelation @ resource.js:336
(anonymous function) @ related-proxy.js:105
tryCatch @ ember.debug.js:52150
invokeCallback @ ember.debug.js:
52165(anonymous function) @ ember.debug.js:54036
(anonymous function) @ ember.debug.js:41257
invoke @ ember.debug.js:990
flush @ ember.debug.js:1054
flush @ ember.debug.js:862
end @ ember.debug.js:176
(anonymous function) @ ember.debug.js:742

@pixelhandler
Copy link
Owner

@pixelhandler
Copy link
Owner

@aars there is a hook that updates the relation after the related proxy resolves.

Simply changing the ids to strings (what they MUST be according to JSONAPI) somehow ends up calling addRelationship on the resource, and then it breaks.

So yeah addRelationship updates the local data on the resource and uses a cacheLookup which wasn't stubbed in the adapter/service mock used in the test.

I'll create a PR to mixup that test.

@pixelhandler
Copy link
Owner

@aars I addressed this buggy test in PR #94

@aars aars deleted the odd-test-failure branch September 23, 2016 10:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants