-
Notifications
You must be signed in to change notification settings - Fork 13
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
Upgrade Ember Data to version 4.12.4
#974
Changes from 6 commits
062ca2e
4a39b91
2d4404e
002dcc3
42e7ef6
b5bdfdb
2ba3531
a0858f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = function (/* environment */) { | ||
return { | ||
buildSandboxGlobals(defaultGlobals) { | ||
return Object.assign({}, defaultGlobals, { | ||
AbortController, | ||
}); | ||
}, | ||
}; | ||
}; |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import { drag } from 'ember-sortable/test-support'; | |
import { module, test } from 'qunit'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
import { setupMirage } from 'ember-cli-mirage/test-support'; | ||
import { settled } from '@ember/test-helpers'; | ||
import { signInAsStaff } from 'codecrafters-frontend/tests/support/authentication-helpers'; | ||
import blocksPage from 'codecrafters-frontend/tests/pages/concept-admin/blocks-page'; | ||
import testScenario from 'codecrafters-frontend/mirage/scenarios/test'; | ||
|
@@ -61,6 +62,8 @@ module('Acceptance | concept-admin | edit-blocks', function (hooks) { | |
await blocksPage.editableBlocks[1].clickOnSaveButton(); | ||
|
||
await blocksPage.clickOnPublishChangesButton(); | ||
await settled(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is interesting - This can be problematic, it'll mean that we have to keep adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @VasylMarchuk probably okay to merge this for now, could you please add a comment to all of these saying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes sounds like a good idea, I also found having to add explicit It feels like some async action is happening, which isn't getting included in the ember run-loop, and isn't tracked automatically by test waiters, then it registers a promise or a Also in one of my previous projects, we had to manually call https://github.com/emberjs/ember-test-waiters/blob/master/addon/addon/wait-for-promise.ts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But also, on the other hand, what's strange is that we have 277 tests, but only 8 tests were failing and I needed to add only 9 extra Will definitely add a comment and maybe worth an extra investigation in a separate PR |
||
|
||
assert.strictEqual(blocksPage.editableBlocks.length, 2, 'expected 2 editable blocks to be present'); | ||
|
||
await blocksPage.insertBlockMarkers[0].click(); | ||
|
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.
@VasylMarchuk I remember that you linked to some github issue that mentioned this - can we add a comment linking to that here please?
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.
I found a reference to a similar problem in this discussion: https://discuss.emberjs.com/t/abortcontroller-errors-after-update/20259/4
It links to an issue in the FastBoot repo: ember-fastboot/ember-cli-fastboot#913
There is a vague reference to this
buildSandboxGlobals
in the FastBoot readme as well: https://github.com/ember-fastboot/ember-cli-fastboot#fastboot-configurationBasically, some of the newer global types/methods (fetch, AbortController, ReadableStream etc) have to be explicitly defined in this list of "globals" that FastBoot makes available in the "sandbox", even though they are natively present in node itself long ago. And it's not really clear and nowhere mentioned in the docs about what's already in this sandbox and what has to be passed explicitly.
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.
@VasylMarchuk I meant to add a comment in the code 🙂 Just for future reference, in case someone wonders what this does