Skip to content

Commit

Permalink
fix: remove comment, trailing space and duplicate from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel-bijaoui committed Sep 6, 2016
1 parent ce3a91c commit e618253
Show file tree
Hide file tree
Showing 25 changed files with 146 additions and 199 deletions.
8 changes: 3 additions & 5 deletions test/unit/specs/fields/fieldCheckbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,16 @@ describe("FieldCheckbox.vue", function() {

expect(input).to.be.defined;
expect(input.type).to.be.equal("checkbox");
// expect(input.disabled).to.be.false;
});

it("should contain the value", (done) => {
vm.$nextTick( () => {
expect(input.checked).to.be.true;
expect(input.checked).to.be.true;
done();
});
});

describe("check optional attribute", () => {
// name which attributes you want to test and that's it.
let attributes = ["autocomplete", "disabled"];

attributes.forEach(function(name) {
Expand All @@ -59,7 +57,7 @@ describe("FieldCheckbox.vue", function() {
it("input value should be the model value after changed", (done) => {
model.status = false;
vm.$nextTick( () => {
expect(input.checked).to.be.false;
expect(input.checked).to.be.false;
done();
});

Expand All @@ -70,7 +68,7 @@ describe("FieldCheckbox.vue", function() {
trigger(input, "change");

vm.$nextTick( () => {
expect(model.status).to.be.true;
expect(model.status).to.be.true;
done();
});

Expand Down
16 changes: 8 additions & 8 deletions test/unit/specs/fields/fieldChecklist.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe("fieldChecklist.vue", function() {
trigger(checkboxes[0], "change");

vm.$nextTick( () => {
expect(model.skills).to.be.deep.equal(["ReactJS", "HTML5"]);
expect(model.skills).to.be.deep.equal(["ReactJS", "HTML5"]);
done();
});

Expand Down Expand Up @@ -145,7 +145,7 @@ describe("fieldChecklist.vue", function() {
trigger(checkboxes[0], "change");

vm.$nextTick( () => {
expect(model.skills).to.be.deep.equal([3, 1]);
expect(model.skills).to.be.deep.equal([3, 1]);
done();
});

Expand Down Expand Up @@ -211,13 +211,13 @@ describe("fieldChecklist.vue", function() {
trigger(checkboxes[0], "change");

vm.$nextTick( () => {
expect(model.skills).to.be.deep.equal([3, 1]);
expect(model.skills).to.be.deep.equal([3, 1]);
done();
});

});

});
});

});

Expand Down Expand Up @@ -308,7 +308,7 @@ describe("fieldChecklist.vue", function() {
trigger(checkboxes[0], "change");

vm.$nextTick( () => {
expect(model.skills).to.be.deep.equal(["ReactJS", "HTML5"]);
expect(model.skills).to.be.deep.equal(["ReactJS", "HTML5"]);
done();
});

Expand All @@ -319,7 +319,7 @@ describe("fieldChecklist.vue", function() {
trigger(checkboxes[0], "change");

vm.$nextTick( () => {
expect(model.skills).to.be.deep.equal(["ReactJS"]);
expect(model.skills).to.be.deep.equal(["ReactJS"]);
done();
});

Expand All @@ -331,11 +331,11 @@ describe("fieldChecklist.vue", function() {
trigger(checkboxes[0], "change");

vm.$nextTick( () => {
expect(model.skills).to.be.deep.equal(["HTML5"]);
expect(model.skills).to.be.deep.equal(["HTML5"]);
done();
});

});
});

});

Expand Down
16 changes: 6 additions & 10 deletions test/unit/specs/fields/fieldCleave.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,16 @@ describe("fieldCleave.vue", function() {
expect(input).to.be.defined;
expect(input.type).to.be.equal("text");
expect(input.classList.contains("form-control")).to.be.true;
// expect(input.placeholder).to.be.equal(schema.placeholder);
// expect(input.readOnly).to.be.false;
// expect(input.disabled).to.be.false;
});

it("should contain the value", (done) => {
vm.$nextTick( () => {
expect(input.value).to.be.equal("30 123 4567");
expect(input.value).to.be.equal("30 123 4567");
done();
});
});

describe("check optional attribute", () => {
// name which attributes you want to test and that's it.
let attributes = ["autocomplete", "disabled", "readonly"];

attributes.forEach(function(name) {
Expand All @@ -68,7 +64,7 @@ describe("fieldCleave.vue", function() {
it("input value should be the model value after changed", (done) => {
model.phone = "70 555 4433";
vm.$nextTick( () => {
expect(input.value).to.be.equal("70 555 4433");
expect(input.value).to.be.equal("70 555 4433");
done();
});

Expand All @@ -79,23 +75,23 @@ describe("fieldCleave.vue", function() {
trigger(input, "input");

vm.$nextTick( () => {
expect(model.phone).to.be.equal("21 888 6655");
expect(model.phone).to.be.equal("21 888 6655");
done();
});

});

it("should be formatted data in model", (done) => {
field.cleave.setRawValue("301234567");
expect(input.value).to.be.equal("30 123 4567");
expect(input.value).to.be.equal("30 123 4567");
trigger(input, "change");

vm.$nextTick( () => {
expect(model.phone).to.be.equal("30 123 4567");
expect(model.phone).to.be.equal("30 123 4567");
done();
});

});
});

});

Expand Down
9 changes: 3 additions & 6 deletions test/unit/specs/fields/fieldColor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,16 @@ describe("fieldColor.vue", function() {

expect(input).to.be.defined;
expect(input.type).to.be.equal("color");
//expect(input.classList.contains("form-control")).to.be.true;
// expect(input.disabled).to.be.false;
});

it("should contain the value", (done) => {
vm.$nextTick( () => {
expect(input.value).to.be.equal("#ff8822");
expect(input.value).to.be.equal("#ff8822");
done();
});
});

describe("check optional attribute", () => {
// name which attributes you want to test and that's it.
let attributes = ["autocomplete"];

attributes.forEach(function(name) {
Expand All @@ -60,7 +57,7 @@ describe("fieldColor.vue", function() {
it("input value should be the model value after changed", (done) => {
model.color = "#ffff00";
vm.$nextTick( () => {
expect(input.value).to.be.equal("#ffff00");
expect(input.value).to.be.equal("#ffff00");
done();
});

Expand All @@ -71,7 +68,7 @@ describe("fieldColor.vue", function() {
trigger(input, "change");

vm.$nextTick( () => {
expect(model.color).to.be.equal("#123456");
expect(model.color).to.be.equal("#123456");
done();
});

Expand Down
14 changes: 6 additions & 8 deletions test/unit/specs/fields/fieldDateTime.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,16 @@ describe("fieldDateTime.vue", function() {
expect(input).to.be.defined;
expect(input.type).to.be.equal("text");
expect(input.classList.contains("form-control")).to.be.true;
expect(input.disabled).to.be.false;
});

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 HH:mm:ss") );
done();
});
});

describe("check optional attribute", () => {
// name which attributes you want to test and that's it.
let attributes = ["autocomplete", "disabled", "placeholder", "readonly"];

attributes.forEach(function(name) {
Expand All @@ -63,7 +61,7 @@ describe("fieldDateTime.vue", function() {
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 HH:mm:ss") );
done();
});

Expand All @@ -74,7 +72,7 @@ describe("fieldDateTime.vue", function() {
trigger(input, "input");

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

Expand Down Expand Up @@ -102,7 +100,7 @@ describe("fieldDateTime.vue", function() {

it("should contain the value", (done) => {
vm.$nextTick( () => {
expect(input.value).to.be.equal( moment("20160509", schema.format).format(schema.dateTimePickerOptions.format) );
expect(input.value).to.be.equal( moment("20160509", schema.format).format(schema.dateTimePickerOptions.format) );
done();
});
});
Expand All @@ -112,11 +110,11 @@ describe("fieldDateTime.vue", function() {
trigger(input, "input");

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

});
});
});

});
10 changes: 3 additions & 7 deletions test/unit/specs/fields/fieldEmail.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,16 @@ describe("fieldEmail.vue", function() {
expect(input).to.be.defined;
expect(input.type).to.be.equal("email");
expect(input.classList.contains("form-control")).to.be.true;
// expect(input.placeholder).to.be.equal(schema.placeholder);
// expect(input.readOnly).to.be.false;
// expect(input.disabled).to.be.false;
});

it("should contain the value", (done) => {
vm.$nextTick( () => {
expect(input.value).to.be.equal("[email protected]");
expect(input.value).to.be.equal("[email protected]");
done();
});
});

describe("check optional attribute", () => {
// name which attributes you want to test and that's it.
let attributes = ["autocomplete", "disabled", "placeholder", "readonly"];

attributes.forEach(function(name) {
Expand All @@ -65,7 +61,7 @@ describe("fieldEmail.vue", function() {
it("input value should be the model value after changed", (done) => {
model.email = "[email protected]";
vm.$nextTick( () => {
expect(input.value).to.be.equal("[email protected]");
expect(input.value).to.be.equal("[email protected]");
done();
});

Expand All @@ -76,7 +72,7 @@ describe("fieldEmail.vue", function() {
trigger(input, "input");

vm.$nextTick( () => {
expect(model.email).to.be.equal("[email protected]");
expect(model.email).to.be.equal("[email protected]");
done();
});

Expand Down
8 changes: 2 additions & 6 deletions test/unit/specs/fields/fieldGoogleAddress.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,16 @@ describe("fieldGoogleAddress.vue", function() {
expect(input).to.be.defined;
expect(input.type).to.be.equal("text");
expect(input.classList.contains("form-control")).to.be.true;
// expect(input.placeholder).to.be.equal(schema.placeholder);
// expect(input.readOnly).to.be.false;
// expect(input.disabled).to.be.false;
});

it("should contain the value", (done) => {
vm.$nextTick( () => {
expect(input.value).to.be.equal("Paris, France");
expect(input.value).to.be.equal("Paris, France");
done();
});
});

describe("check optional attribute", () => {
// name which attributes you want to test and that's it.
let attributes = ["autocomplete", "disabled", "placeholder", "readonly"];

attributes.forEach(function(name) {
Expand All @@ -64,7 +60,7 @@ describe("fieldGoogleAddress.vue", function() {
it("input value should be the model value after changed", (done) => {
model.address = "Rome, Italy";
vm.$nextTick( () => {
expect(input.value).to.be.equal("Rome, Italy");
expect(input.value).to.be.equal("Rome, Italy");
done();
});

Expand Down
Loading

0 comments on commit e618253

Please sign in to comment.