Skip to content

Commit

Permalink
check dom props in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
aristov committed Sep 23, 2015
1 parent 70c5450 commit bba3970
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions common.blocks/radio/radio.spec.js
Expand Up @@ -29,11 +29,13 @@ describe('radio', function() {
it('should properly update "control" elem "checked" attr', function() {
radioOption
.setMod('checked')
.elem('control').attr('checked').should.be.equal('checked');
.elem('control').prop('checked').should.be.true;
radioOption.elem('control').attr('checked').should.be.equal('checked');

chai.expect(radioOption
radioOption
.delMod('checked')
.elem('control').attr('checked')).to.be.undefined;
.elem('control').prop('checked').should.be.false;
chai.expect(radioOption.elem('control').attr('checked')).to.be.undefined;
});

it('should set "checked" mod on "change" event', function() {
Expand Down
2 changes: 2 additions & 0 deletions common.blocks/select/_mode/select_mode_check.spec.js
Expand Up @@ -30,9 +30,11 @@ describe('select_mode_check', function() {
describe('enable/disable', function() {
it('should enable/disable control elems according to self "disabled" state', function() {
select.setMod('disabled');
select.elem('control').prop('disabled').should.be.true;
select.elem('control').attr('disabled').should.be.equal('disabled');

select.delMod('disabled');
select.elem('control').prop('disabled').should.be.false;
chai.expect(select.elem('control').attr('disabled')).to.be.undefined;
});
});
Expand Down
2 changes: 2 additions & 0 deletions common.blocks/select/_mode/select_mode_radio-check.spec.js
Expand Up @@ -29,9 +29,11 @@ describe('select_mode_radio-check', function() {
describe('enable/disable', function() {
it('should enable/disable control elems according to self "disabled" state', function() {
select.setMod('disabled');
select.elem('control').prop('disabled').should.be.true;
select.elem('control').attr('disabled').should.be.equal('disabled');

select.delMod('disabled');
select.elem('control').prop('disabled').should.be.false;
chai.expect(select.elem('control').attr('disabled')).to.be.undefined;
});
});
Expand Down
2 changes: 2 additions & 0 deletions common.blocks/select/_mode/select_mode_radio.spec.js
Expand Up @@ -28,9 +28,11 @@ describe('select_mode_radio', function() {
describe('enable/disable', function() {
it('should enable/disable control elems according to self "disabled" state', function() {
select.setMod('disabled');
select.elem('control').prop('disabled').should.be.true;
select.elem('control').attr('disabled').should.be.equal('disabled');

select.delMod('disabled');
select.elem('control').prop('disabled').should.be.false;
chai.expect(select.elem('control').attr('disabled')).to.be.undefined;
});
});
Expand Down

0 comments on commit bba3970

Please sign in to comment.