Skip to content

Commit

Permalink
Fix toggled test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Radchenko committed Mar 31, 2015
1 parent 51be04f commit a132031
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/components/x-toggle-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ test('it renders', function(assert) {
assert.equal(component._state, 'inDOM');
});

test('changing value changes state', function (assert) {
test('changing toggled changes state', function (assert) {
assert.expect(3);

var component = this.subject();

assert.equal(this.$('input.x-toggle').attr('checked'), false, 'unchecked by default');
assert.equal(this.$('input.x-toggle').prop('checked'), false, 'unchecked by default');

Ember.run(function () {
component.set('value', true);
component.set('toggled', true);
});

assert.equal(this.$('input.x-toggle').attr('checked'), true, 'checked when value: true');
assert.equal(this.$('input.x-toggle').prop('checked'), true, 'checked when toggled: true');

Ember.run(function () {
component.set('value', false);
component.set('toggled', false);
});

assert.equal(this.$('input.x-toggle').attr('checked'), false, 'unchecked when value: false');
assert.equal(this.$('input.x-toggle').prop('checked'), false, 'unchecked when toggled: false');
});

0 comments on commit a132031

Please sign in to comment.