Skip to content

Commit

Permalink
fix pikaday unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Aug 25, 2016
1 parent 8e528b4 commit 23f5a90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/fields/fieldPikaday.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import moment from "moment";
import { defaults } from "lodash";
let inputFormat = "YYYY-MM-DD HH:mm:ss";
let inputFormat = "YYYY-MM-DD";
export default {
mixins: [ abstractField ],
Expand Down
2 changes: 1 addition & 1 deletion test/unit/specs/fields/fieldDateTime.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function createField(schema = {}, model = null, disabled = false, options) {
[ el, vm, field ] = createVueField("fieldDateTime", schema, model, disabled, options);
}

describe.only("fieldDateTime.vue", () => {
describe("fieldDateTime.vue", () => {

describe("check template", () => {
let schema = {
Expand Down
10 changes: 5 additions & 5 deletions test/unit/specs/fields/fieldPikaday.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function createField(schema = {}, model = null, disabled = false, options) {
[ el, vm, field ] = createVueField("fieldPikaday", schema, model, disabled, options);
}

describe("fieldPikaday.vue", () => {
describe.only("fieldPikaday.vue", () => {

describe("check template", () => {
let schema = {
Expand Down Expand Up @@ -41,7 +41,7 @@ describe("fieldPikaday.vue", () => {

it("should contain the value", (done) => {
vm.$nextTick( () => {
expect(input.value).to.be.equal( moment(1462799081231).format("YYYY-MM-DD HH:mm:ss") );
expect(input.value).to.be.equal( moment(1462799081231).format("YYYY-MM-DD") );
done();
});
});
Expand All @@ -57,18 +57,18 @@ describe("fieldPikaday.vue", () => {
it("input value should be the model value after changed", (done) => {
model.event = 1234567890123;
vm.$nextTick( () => {
expect(input.value).to.be.equal( moment(1234567890123).format("YYYY-MM-DD HH:mm:ss") );
expect(input.value).to.be.equal( moment(1234567890123).format("YYYY-MM-DD") );
done();
});

});

it("model value should be the input value if changed", (done) => {
input.value = moment(1420194153000).format("YYYY-MM-DD HH:mm:ss");
input.value = moment(1420153200000).format("YYYY-MM-DD");
trigger(input, "input");

vm.$nextTick( () => {
expect(model.event).to.be.equal(1420194153000);
expect(model.event).to.be.equal(1420153200000);
done();
});

Expand Down

0 comments on commit 23f5a90

Please sign in to comment.