Skip to content

Commit

Permalink
fix checkbox tests
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Jan 30, 2017
1 parent 8d3ca97 commit 593307b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/fields/fieldCheckbox.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input(type="checkbox", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :name="schema.inputName")
input(type="checkbox", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :name="schema.inputName")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion test/unit/specs/fields/fieldCheckbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe("FieldCheckbox.vue", function() {

it("model value should be the input value if changed", (done) => {
input.checked = true;
trigger(input, "change");
trigger(input, "click");

vm.$nextTick( () => {
expect(model.status).to.be.true;
Expand Down
5 changes: 3 additions & 2 deletions test/unit/specs/fields/fieldSwitch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ describe("FieldSwitch.vue", function() {
field.disabled = true;
vm.$nextTick( () => {
expect(input.disabled).to.be.true;
field.disabled = false;
done();
});
});
Expand All @@ -79,7 +80,7 @@ describe("FieldSwitch.vue", function() {

it("model value should be the input value if changed", (done) => {
input.checked = true;
trigger(input, "change");
trigger(input, "click");

vm.$nextTick( () => {
expect(model.status).to.be.true;
Expand Down Expand Up @@ -147,7 +148,7 @@ describe("FieldSwitch.vue", function() {

it("model value should be the input value if changed", (done) => {
input.checked = true;
trigger(input, "change");
trigger(input, "click");

vm.$nextTick( () => {
expect(model.sex).to.be.equal("female");
Expand Down

0 comments on commit 593307b

Please sign in to comment.