-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
fix 430, support ember-source 3.13 #460
Conversation
Fix 430. We need to explicitly delete user set keys on the `this` context. The prior approach tried to rebuild the entire `this` object. That caused problems with Ember 3.13 and up because of some changes for tracked properties. This approach infers user defined keys and deletes those and a known list.
Using this.set('myKey', null) instead of delete this['myKey'] properly delegates setter logic so we keep tests isolated.
👍 tested and confirmed working for me 🎉 Looks like the only tests still failing in our test suite now are more directly related to 3.13 |
that's good news. thanks for testing @kevinansfield! |
Hmm, I think I was too quick to assume our remaining failing tests were 3.13 related. It appears the problem is properties set on it('triggers multiple uploads', async function () {
await render(hbs`{{#gh-uploader files=files}}{{/gh-uploader}}`);
this.set('files', [createFile(), createFile(), createFile()]);
await settled();
expect(server.handledRequests.length).to.equal(3);
});
it('triggers onStart when upload starts', async function () {
this.set('uploadStarted', sinon.spy());
await render(hbs`{{#gh-uploader files=files onStart=(action uploadStarted)}}{{/gh-uploader}}`);
this.set('files', [createFile(), createFile()]);
await settled();
expect(this.get('uploadStarted').calledOnce).to.be.true;
}); The second test is failing because Re-checked 3.12 to make sure and |
Tested against #462 and that one is fully working 👍 |
Closing this PR as well because it doesn't fully resolve the issue. #462 does so because it uses the corresponding teardown method from Ember's tracked properties. There are questions to address there and feedback on a possible public API to do this. |
This PR fixes #430 and adds support for [email protected].
See #450 for the background conversation and root cause analysis (thanks to @simonihmig 😄 ).
I do a couple things here.
set
,get
, and others. I changed it to only tear down user defined keys andowner
.this.set('someKey', null)
. This properly delegates the setter behavior for the tracked property logic of ember-source >= 3.13Change 2 is optional so I can rebase with only 1 and 3 if is preferred.