Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIDE QUEST] MinimumSerializerInterface Tests #6460

Closed
17 tasks done
runspired opened this issue Sep 17, 2019 · 4 comments
Closed
17 tasks done

[SIDE QUEST] MinimumSerializerInterface Tests #6460

runspired opened this issue Sep 17, 2019 · 4 comments
Labels
🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166

Comments

@runspired
Copy link
Contributor

runspired commented Sep 17, 2019

A Side-Quest for Project Trim!

Side Quests?!?! How fun!

Mission

#6459 introduced test infrastructure for testing ember-data without the @ember-data/serializer package being present at all while #6451 introduced the MinimumSerializerInterface. In this repository we want to add integration tests covering three areas.

  • requests
  • mutation
  • serialization

The following things should be tested:

Requests

  • store.<findAll|findRecord|query|queryRecord> call serializer.normalizeResponse with the store methodName as the requestType once the adapter resolves
  • accessing an async hasMany relationship without links results in serializer.normalizeResponse being called with the requestType findMany
  • accessing an async hasMany relationship with links results in serializer.normalizeResponse being called with the requestType findHasMany
  • accessing an async belongsTo relationship with links results in serializer.normalizeResponse being called with the requestType findBelongsTo
  • errors in JSON:API format "just work" with no extractErrors hook on the serializer

Mutation

  • normalizeResponse deleteRecord
  • serialize updateRecord
  • serializeIntoHash if present updateRecord
  • normalizeResponse updateRecord
  • serializeIntoHash if present createRecord
  • serialize createRecord
  • normalizeResponse createRecord

Serialization/Normalization

  • record.serialize
  • store.serialize
  • snapshot.serialize
  • store.normalize
  • store.pushPayload calls serializer.pushPayload
@runspired runspired added 🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166 Good for New Contributors labels Sep 17, 2019
@runspired
Copy link
Contributor Author

@Gaurav0 is going to work to complete this side-quest :)

@Gaurav0
Copy link
Contributor

Gaurav0 commented Oct 1, 2019

I've interpreted record.serialize as Model.serialize, but there doesn't seem to be a store.serialize?

@Gaurav0
Copy link
Contributor

Gaurav0 commented Oct 8, 2019

Side quest completed solo.

@runspired
Copy link
Contributor Author

And much appreciation for it! Great work :D I'm very happy to have all the additional test coverage this introduced :)

P.S. I'll be speccing out the tests for Adapters this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166
Projects
None yet
Development

No branches or pull requests

2 participants