Skip to content

Commit

Permalink
fix test memory leaks
Browse files Browse the repository at this point in the history
ember-cli-memory-leak-detector identified 3 leaked instances of
PowerSelect after a full run of the test suite.
Converting 3 instances of onclick to {{on "click ...}} in test code
fixed the leaks that were found.
  • Loading branch information
steveszc committed Mar 26, 2021
1 parent a9c36de commit 3ce469d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,14 @@ module('Integration | Component | Ember Power Select (Customization using compon
test('the `@beforeOptionsComponent` and `@afterOptionsComponent` receive the `@extra` hash', async function(assert) {
assert.expect(1);
this.owner.register('component:custom-before-options2', Component.extend({
layout: hbs`<button class="custom-before-options2-button" onclick={{@extra.passedAction}}>Do something</button>`
}));
this.owner.register('component:custom-after-options2', Component.extend({
layout: hbs`<button class="custom-after-options2-button" onclick={{@extra.passedAction}}>Do something</button>`
layout: hbs`<button class="custom-before-options2-button" {{on "click" @extra.passedAction}}>Do something</button>`
}));
this.owner.register(
"component:custom-after-options2",
Component.extend({
layout: hbs`<button class="custom-after-options2-button" {{on "click" @extra.passedAction}}>Do something</button>`,
})
);
let counter = 0;
this.countries = countries;
this.country = countries[1]; // Spain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ module('Integration | Component | Ember Power Select (General behavior)', functi
};

await render(hbs`
<button id="refresh-collection-btn" onclick={{action refreshCollection}}>Refresh collection</button>
<button id="refresh-collection-btn" {{on "click" (action refreshCollection)}}>Refresh collection</button>
<br>
<PowerSelect @options={{options}} @selected={{selected}} @onChange={{action (mut selected)}} as |name|>
{{name}}
Expand Down

0 comments on commit 3ce469d

Please sign in to comment.