-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: docs, tests and fixes for create/update/deleteRecord builders #8849
Conversation
6b6fb7d
to
9d8be6c
Compare
export function createRecord(record: unknown, options: ConstrainedRequestOptions = {}): CreateRequestOptions { | ||
const identifier = recordIdentifierFor(record); | ||
assert(`Expected to be given a record instance`, identifier); | ||
assert(`Cannot delete a record that does not have an associated type and id.`, isExisting(identifier)); | ||
// TODO: seems to be wrong assert here, at least message is confusing | ||
// assert(`Cannot delete a record that does not have an associated type and id.`, isExisting(identifier)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to wrong assertion, you should be able to create a record without an identifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leepfrog not exactly. You do need an identifier, the identifier does not need an id
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! Yes, agree!
5bd87fe
to
c749f6f
Compare
// Handle testing feature flags | ||
if (QUnit.urlParams.enableoptionalfeatures) { | ||
window.EmberDataENV = { ENABLE_OPTIONAL_FEATURES: true }; | ||
} | ||
|
||
configureAsserts(); | ||
|
||
setApplication(Application.create(config.APP)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in follow up we should eliminate this and the new app files in favor of in-test-file registration
Documentation for rest of the builder functions
This PR aims to cover create-record / update-record / delete-record documentation
Should be added to json-api / rest / active-record packages