Skip to content

Commit

Permalink
Merge pull request #68 from vaadin/restore-iron-form-tests
Browse files Browse the repository at this point in the history
Restore iron-form tests
  • Loading branch information
tomivirkki authored Jan 26, 2018
2 parents 3ac6ecf + ce80dd9 commit c3803db
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/vaadin-checkbox_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
<dom-module id="x-checkbox">
<template>
<iron-form id="form">
<vaadin-checkbox id="boundname" name="[[checkboxName]]"></vaadin-checkbox>
<vaadin-checkbox id="attrname" name="attrcheckbox"></vaadin-checkbox>
<form>
<vaadin-checkbox id="boundname" name="[[checkboxName]]"></vaadin-checkbox>
<vaadin-checkbox id="attrname" name="attrcheckbox"></vaadin-checkbox>
</form>
</iron-form>
</template>
<script>
Expand Down Expand Up @@ -223,13 +225,13 @@
it('should serialize', () => {
boundNameCheckbox.checked = true;
expect(boundNameCheckbox.name).to.equal('boundcheckbox');
expect(form.serializeForm().boundcheckbox).to.include('on');
expect(form.serializeForm().boundcheckbox).to.equal('on');
});

it('should serialize with a custom value', () => {
boundNameCheckbox.checked = true;
boundNameCheckbox.value = 'foo';
expect(form.serializeForm().boundcheckbox).to.include('foo');
expect(form.serializeForm().boundcheckbox).to.equal('foo');
});

it('should not serialize when not checked', () => {
Expand All @@ -251,7 +253,7 @@

it('should define the name from an attribute', () => {
attrNameCheckbox.checked = true;
expect(form.serializeForm().attrcheckbox).to.include('on');
expect(form.serializeForm().attrcheckbox).to.equal('on');
});

});
Expand Down

0 comments on commit c3803db

Please sign in to comment.