Commit 66ae31ce authored by Pascal Hartig's avatar Pascal Hartig

flight: Add test for toggle_all

parent bafcb596
......@@ -12,7 +12,7 @@ define([
};
this.toggleCheckbox = function (e, data) {
this.$node[0].checked = !data.remaining;
this.node.checked = !data.remaining;
};
this.after('initialize', function () {
......
<input id="toggle-all" type="checkbox">
describeComponent('app/js/ui/toggle_all', function () {
'use strict';
beforeEach(function () {
setupComponent(readFixtures('toggle_all.html'));
});
it('check the checkbox w/o remaining', function () {
var data = {
all: 2,
remaining: 0,
completed: 2,
filter: ''
};
$(document).trigger('dataStatsCounted', data);
expect(this.component.$node).toBeChecked();
});
it('uncheck the checkbox w/ remaining', function () {
var data = {
all: 2,
remaining: 1,
completed: 1,
filter: ''
};
$(document).trigger('dataStatsCounted', data);
expect(this.component.$node).not.toBeChecked();
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment