Skip to content

Commit

Permalink
Merge pull request #15162 from emberjs/cp-14947
Browse files Browse the repository at this point in the history
CherryPick tests from 14947
  • Loading branch information
stefanpenner authored Apr 24, 2017
2 parents e36d849 + a97f8c5 commit adcc0e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/ember-glimmer/lib/components/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default EmberComponent.extend({
],

type: 'checkbox',
checked: false,
disabled: false,
indeterminate: false,

Expand All @@ -61,6 +60,6 @@ export default EmberComponent.extend({
},

change() {
set(this, 'checked', this.$().prop('checked'));
set(this, 'checked', this.$().prop('checked'));
}
});
12 changes: 11 additions & 1 deletion packages/ember-glimmer/tests/integration/helpers/input-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,17 @@ moduleFor(`Helpers test: {{input type='checkbox'}}`, class extends InputRenderin
this.assertCheckboxIsChecked();
}

['@test native click changes check property'](assert) {
this.render(`{{input type="checkbox"}}`);

this.assertSingleCheckbox();
this.assertCheckboxIsNotChecked();
this.$input()[0].click();
this.assertCheckboxIsChecked();
this.$input()[0].click();
this.assertCheckboxIsNotChecked();
}

['@test with static values'](assert) {
this.render(`{{input type="checkbox" disabled=false tabindex=10 name="original-name" checked=false}}`);

Expand All @@ -552,7 +563,6 @@ moduleFor(`Helpers test: {{input type='checkbox'}}`, class extends InputRenderin
this.assertAttr('tabindex', '10');
this.assertAttr('name', 'original-name');
}

});

moduleFor(`Helpers test: {{input type='text'}}`, class extends InputRenderingTest {
Expand Down

0 comments on commit adcc0e0

Please sign in to comment.