From e618253c3f7574027c1a23cb75a61de1332eefbd Mon Sep 17 00:00:00 2001 From: Lionel Bijaoui Date: Tue, 6 Sep 2016 18:24:23 +0200 Subject: [PATCH] fix: remove comment, trailing space and duplicate from tests --- test/unit/specs/fields/fieldCheckbox.spec.js | 8 ++--- test/unit/specs/fields/fieldChecklist.spec.js | 16 +++++----- test/unit/specs/fields/fieldCleave.spec.js | 16 ++++------ test/unit/specs/fields/fieldColor.spec.js | 9 ++---- test/unit/specs/fields/fieldDateTime.spec.js | 14 ++++----- test/unit/specs/fields/fieldEmail.spec.js | 10 ++----- .../specs/fields/fieldGoogleAddress.spec.js | 8 ++--- test/unit/specs/fields/fieldImage.spec.js | 29 +++++++++---------- test/unit/specs/fields/fieldLabel.spec.js | 4 +-- test/unit/specs/fields/fieldMasked.spec.js | 16 ++++------ .../unit/specs/fields/fieldNoUiSlider.spec.js | 14 ++++----- test/unit/specs/fields/fieldNumber.spec.js | 14 ++++----- test/unit/specs/fields/fieldPassword.spec.js | 10 ++----- test/unit/specs/fields/fieldPikaday.spec.js | 10 +++---- test/unit/specs/fields/fieldRange.spec.js | 12 ++++---- test/unit/specs/fields/fieldSelect.spec.js | 24 +++++++-------- test/unit/specs/fields/fieldSelectEx.spec.js | 29 +++++++++---------- test/unit/specs/fields/fieldSlider.spec.js | 15 +++++----- test/unit/specs/fields/fieldSpectrum.spec.js | 9 ++---- test/unit/specs/fields/fieldStaticMap.spec.js | 4 +-- test/unit/specs/fields/fieldSubmit.spec.js | 16 +++++----- test/unit/specs/fields/fieldSwitch.spec.js | 18 ++++++------ test/unit/specs/fields/fieldText.spec.js | 10 ++----- test/unit/specs/fields/fieldTextArea.spec.js | 14 ++++----- .../specs/fields/fieldVueMultiSelect.spec.js | 16 +++++----- 25 files changed, 146 insertions(+), 199 deletions(-) diff --git a/test/unit/specs/fields/fieldCheckbox.spec.js b/test/unit/specs/fields/fieldCheckbox.spec.js index 96f6e30b..1e1094ee 100644 --- a/test/unit/specs/fields/fieldCheckbox.spec.js +++ b/test/unit/specs/fields/fieldCheckbox.spec.js @@ -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) { @@ -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(); }); @@ -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(); }); diff --git a/test/unit/specs/fields/fieldChecklist.spec.js b/test/unit/specs/fields/fieldChecklist.spec.js index f7c87c7c..b899b399 100644 --- a/test/unit/specs/fields/fieldChecklist.spec.js +++ b/test/unit/specs/fields/fieldChecklist.spec.js @@ -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(); }); @@ -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(); }); @@ -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(); }); }); - }); + }); }); @@ -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(); }); @@ -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(); }); @@ -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(); }); - }); + }); }); diff --git a/test/unit/specs/fields/fieldCleave.spec.js b/test/unit/specs/fields/fieldCleave.spec.js index 75af8a7c..173db112 100644 --- a/test/unit/specs/fields/fieldCleave.spec.js +++ b/test/unit/specs/fields/fieldCleave.spec.js @@ -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) { @@ -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(); }); @@ -79,7 +75,7 @@ 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(); }); @@ -87,15 +83,15 @@ describe("fieldCleave.vue", function() { 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(); }); - }); + }); }); diff --git a/test/unit/specs/fields/fieldColor.spec.js b/test/unit/specs/fields/fieldColor.spec.js index 7d2602a6..15344b5b 100644 --- a/test/unit/specs/fields/fieldColor.spec.js +++ b/test/unit/specs/fields/fieldColor.spec.js @@ -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) { @@ -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(); }); @@ -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(); }); diff --git a/test/unit/specs/fields/fieldDateTime.spec.js b/test/unit/specs/fields/fieldDateTime.spec.js index 2e42cf71..daeaec1b 100644 --- a/test/unit/specs/fields/fieldDateTime.spec.js +++ b/test/unit/specs/fields/fieldDateTime.spec.js @@ -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) { @@ -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(); }); @@ -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(); }); @@ -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(); }); }); @@ -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(); }); - }); + }); }); }); diff --git a/test/unit/specs/fields/fieldEmail.spec.js b/test/unit/specs/fields/fieldEmail.spec.js index 7aa54de4..e988ba74 100644 --- a/test/unit/specs/fields/fieldEmail.spec.js +++ b/test/unit/specs/fields/fieldEmail.spec.js @@ -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("john.doe@company.org"); + expect(input.value).to.be.equal("john.doe@company.org"); 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) { @@ -65,7 +61,7 @@ describe("fieldEmail.vue", function() { it("input value should be the model value after changed", (done) => { model.email = "john.doe@gmail.com"; vm.$nextTick( () => { - expect(input.value).to.be.equal("john.doe@gmail.com"); + expect(input.value).to.be.equal("john.doe@gmail.com"); done(); }); @@ -76,7 +72,7 @@ describe("fieldEmail.vue", function() { trigger(input, "input"); vm.$nextTick( () => { - expect(model.email).to.be.equal("john.smith@company.org"); + expect(model.email).to.be.equal("john.smith@company.org"); done(); }); diff --git a/test/unit/specs/fields/fieldGoogleAddress.spec.js b/test/unit/specs/fields/fieldGoogleAddress.spec.js index 7e89430f..8a19e695 100644 --- a/test/unit/specs/fields/fieldGoogleAddress.spec.js +++ b/test/unit/specs/fields/fieldGoogleAddress.spec.js @@ -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) { @@ -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(); }); diff --git a/test/unit/specs/fields/fieldImage.spec.js b/test/unit/specs/fields/fieldImage.spec.js index b7b8039a..94c9dbf1 100644 --- a/test/unit/specs/fields/fieldImage.spec.js +++ b/test/unit/specs/fields/fieldImage.spec.js @@ -40,9 +40,9 @@ describe("fieldImage.vue", function() { expect(input).to.be.defined; expect(input.classList.contains("form-control")).to.be.true; expect(input.classList.contains("link")).to.be.true; - expect(input.placeholder).to.be.equal(schema.placeholder); - expect(input.readOnly).to.be.false; - expect(input.disabled).to.be.false; + expect(input.placeholder).to.be.equal(schema.placeholder); + expect(input.readOnly).to.be.false; + expect(input.disabled).to.be.false; }); it("should contain a file input element", () => { @@ -50,25 +50,24 @@ describe("fieldImage.vue", function() { expect(fileInput).to.be.defined; expect(fileInput.classList.contains("form-control")).to.be.true; expect(fileInput.classList.contains("file")).to.be.true; - expect(fileInput.readOnly).to.be.false; - expect(fileInput.disabled).to.be.false; - }); + expect(fileInput.readOnly).to.be.false; + expect(fileInput.disabled).to.be.false; + }); it("should not visible the preview div", () => { let preview = el.querySelector(".preview"); expect(preview.style.display).to.be.equal("block"); - }); + }); it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal(model.avatar); + expect(input.value).to.be.equal(model.avatar); 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) { @@ -81,7 +80,7 @@ describe("fieldImage.vue", function() { it("input value should be the model value after changed", (done) => { model.avatar = "https://s3.amazonaws.com/uifaces/faces/twitter/felipebsb/128.jpg"; vm.$nextTick( () => { - expect(input.value).to.be.equal("https://s3.amazonaws.com/uifaces/faces/twitter/felipebsb/128.jpg"); + expect(input.value).to.be.equal("https://s3.amazonaws.com/uifaces/faces/twitter/felipebsb/128.jpg"); done(); }); @@ -92,7 +91,7 @@ describe("fieldImage.vue", function() { trigger(input, "change"); vm.$nextTick( () => { - expect(model.avatar).to.be.equal("https://s3.amazonaws.com/uifaces/faces/twitter/peterme/128.jpg"); + expect(model.avatar).to.be.equal("https://s3.amazonaws.com/uifaces/faces/twitter/peterme/128.jpg"); done(); }); @@ -106,7 +105,7 @@ describe("fieldImage.vue", function() { expect(fileInput).to.be.null; done(); }); - }); + }); it("should not visible the preview div", (done) => { vm.$set("schema.preview", false); @@ -116,7 +115,7 @@ describe("fieldImage.vue", function() { expect(preview.style.display).to.be.equal("none"); done(); }); - }); + }); it("should not show base64 data in input field", (done) => { model.avatar = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ"; @@ -125,7 +124,7 @@ describe("fieldImage.vue", function() { expect(input.value).to.be.equal(""); done(); }); - }); + }); it("should clear input if press remove icon", (done) => { vm.$set("schema.preview", true); @@ -171,7 +170,7 @@ describe("fieldImage.vue", function() { window.FileReader = FR; done(); }); - }); + }); }); diff --git a/test/unit/specs/fields/fieldLabel.spec.js b/test/unit/specs/fields/fieldLabel.spec.js index a0e6c5ae..86bc3780 100644 --- a/test/unit/specs/fields/fieldLabel.spec.js +++ b/test/unit/specs/fields/fieldLabel.spec.js @@ -37,7 +37,7 @@ describe("fieldLabel.vue", function() { it("should contain the value", (done) => { vm.$nextTick( () => { - expect(span.textContent).to.be.equal("2 days ago"); + expect(span.textContent).to.be.equal("2 days ago"); done(); }); }); @@ -45,7 +45,7 @@ describe("fieldLabel.vue", function() { it("input value should be the model value after changed", (done) => { model.timestamp = "Foo bar"; vm.$nextTick( () => { - expect(span.textContent).to.be.equal("Foo bar"); + expect(span.textContent).to.be.equal("Foo bar"); done(); }); diff --git a/test/unit/specs/fields/fieldMasked.spec.js b/test/unit/specs/fields/fieldMasked.spec.js index ee25c507..df843e49 100644 --- a/test/unit/specs/fields/fieldMasked.spec.js +++ b/test/unit/specs/fields/fieldMasked.spec.js @@ -39,20 +39,16 @@ describe("fieldMasked.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", "placeholder", "readonly"]; attributes.forEach(function(name) { @@ -65,7 +61,7 @@ describe("fieldMasked.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(); }); @@ -76,7 +72,7 @@ describe("fieldMasked.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(); }); @@ -86,14 +82,14 @@ describe("fieldMasked.vue", function() { input.value = "123456789"; // Call the paste event what trigger the formatter let $input = window.jQuery(input); - $input.trigger(window.jQuery.Event("paste")); + $input.trigger(window.jQuery.Event("paste")); setTimeout( () => { - expect(input.value).to.be.equal("(12) 345-6789"); + expect(input.value).to.be.equal("(12) 345-6789"); trigger(input, "input"); vm.$nextTick( () => { - expect(model.phone).to.be.equal("(12) 345-6789"); + expect(model.phone).to.be.equal("(12) 345-6789"); done(); }); diff --git a/test/unit/specs/fields/fieldNoUiSlider.spec.js b/test/unit/specs/fields/fieldNoUiSlider.spec.js index bea2f83d..a292588f 100644 --- a/test/unit/specs/fields/fieldNoUiSlider.spec.js +++ b/test/unit/specs/fields/fieldNoUiSlider.spec.js @@ -56,7 +56,7 @@ describe("fieldNoUiSlider.vue", function() { it("should contain the value", (done) => { vm.$nextTick( () => { - let origin = input.querySelector(".noUi-origin"); + let origin = input.querySelector(".noUi-origin"); expect(origin.style.left).to.be.within("70%", "90%"); done(); }); @@ -65,22 +65,22 @@ describe("fieldNoUiSlider.vue", function() { it("handle value should be the model value after changed", (done) => { field.model = { rating: 10 }; setTimeout( () => { - let origin = input.querySelector(".noUi-origin"); - expect(origin.style.left).to.be.equal("100%"); + let origin = input.querySelector(".noUi-origin"); + expect(origin.style.left).to.be.equal("100%"); done(); }, 100); }); it("model value should be the handle value after changed", (done) => { - // `field.slider.noUiSlider.set(3);` - It doesn't fired the onChange event + // `field.slider.noUiSlider.set(3);` - It doesn't fired the onChange event field.onChange(3); setTimeout( () => { - expect(vm.model.rating).to.be.equal(3); + expect(vm.model.rating).to.be.equal(3); done(); }, 100); }); - - it("should set disabled", (done) => { + + it("should set disabled", (done) => { field.disabled = true; vm.$nextTick( () => { // This is not real input, it is a div. So we can check the disabled attribute diff --git a/test/unit/specs/fields/fieldNumber.spec.js b/test/unit/specs/fields/fieldNumber.spec.js index 560e5737..99b83c7e 100644 --- a/test/unit/specs/fields/fieldNumber.spec.js +++ b/test/unit/specs/fields/fieldNumber.spec.js @@ -40,21 +40,17 @@ describe("fieldNumber.vue", function() { expect(input).to.be.defined; expect(input.type).to.be.equal("number"); 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.min).to.be.equal("18"); - expect(input.max).to.be.equal("100"); - expect(input.disabled).to.be.false; + expect(input.min).to.be.equal("18"); + expect(input.max).to.be.equal("100"); }); it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal("27"); + expect(input.value).to.be.equal("27"); 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) { @@ -67,7 +63,7 @@ describe("fieldNumber.vue", function() { it("input value should be the model value after changed", (done) => { model.age = 35; vm.$nextTick( () => { - expect(input.value).to.be.equal("35"); + expect(input.value).to.be.equal("35"); done(); }); @@ -78,7 +74,7 @@ describe("fieldNumber.vue", function() { trigger(input, "input"); vm.$nextTick( () => { - expect(model.age).to.be.equal(50); + expect(model.age).to.be.equal(50); done(); }); diff --git a/test/unit/specs/fields/fieldPassword.spec.js b/test/unit/specs/fields/fieldPassword.spec.js index 314cd420..e91e6c06 100644 --- a/test/unit/specs/fields/fieldPassword.spec.js +++ b/test/unit/specs/fields/fieldPassword.spec.js @@ -39,20 +39,16 @@ describe("fieldPassword.vue", function() { expect(input).to.be.defined; expect(input.type).to.be.equal("password"); 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("123456!"); + expect(input.value).to.be.equal("123456!"); 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) { @@ -65,7 +61,7 @@ describe("fieldPassword.vue", function() { it("input value should be the model value after changed", (done) => { model.password = "J0hnD03!x4"; vm.$nextTick( () => { - expect(input.value).to.be.equal("J0hnD03!x4"); + expect(input.value).to.be.equal("J0hnD03!x4"); done(); }); @@ -76,7 +72,7 @@ describe("fieldPassword.vue", function() { trigger(input, "input"); vm.$nextTick( () => { - expect(model.password).to.be.equal("pass 1234&"); + expect(model.password).to.be.equal("pass 1234&"); done(); }); diff --git a/test/unit/specs/fields/fieldPikaday.spec.js b/test/unit/specs/fields/fieldPikaday.spec.js index 4beaef24..0f7ba763 100644 --- a/test/unit/specs/fields/fieldPikaday.spec.js +++ b/test/unit/specs/fields/fieldPikaday.spec.js @@ -39,18 +39,16 @@ describe("fieldPikaday.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") ); + expect(input.value).to.be.equal( moment(1462799081231).format("YYYY-MM-DD") ); 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) { @@ -63,7 +61,7 @@ describe("fieldPikaday.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") ); + expect(input.value).to.be.equal( moment(1234567890123).format("YYYY-MM-DD") ); done(); }); @@ -74,8 +72,8 @@ describe("fieldPikaday.vue", function() { field.picker.setDate(day); vm.$nextTick( () => { - expect(input.value).to.be.equal(day); - expect(moment(model.event).format("YYYY-MM-DD")).to.be.equal(day); + expect(input.value).to.be.equal(day); + expect(moment(model.event).format("YYYY-MM-DD")).to.be.equal(day); done(); }); diff --git a/test/unit/specs/fields/fieldRange.spec.js b/test/unit/specs/fields/fieldRange.spec.js index 51120faf..603d004d 100644 --- a/test/unit/specs/fields/fieldRange.spec.js +++ b/test/unit/specs/fields/fieldRange.spec.js @@ -38,20 +38,18 @@ describe("fieldRange.vue", function() { expect(input).to.be.defined; expect(input.type).to.be.equal("range"); expect(input.classList.contains("form-control")).to.be.true; - expect(input.min).to.be.equal("1"); - expect(input.max).to.be.equal("10"); - expect(input.disabled).to.be.false; + expect(input.min).to.be.equal("1"); + expect(input.max).to.be.equal("10"); }); it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal("8"); + expect(input.value).to.be.equal("8"); done(); }); }); describe("check optional attribute", () => { - // name which attributes you want to test and that's it. let attributes = ["autocomplete", "disabled"]; attributes.forEach(function(name) { @@ -64,7 +62,7 @@ describe("fieldRange.vue", function() { it("input value should be the model value after changed", (done) => { model.rating = 3; vm.$nextTick( () => { - expect(input.value).to.be.equal("3"); + expect(input.value).to.be.equal("3"); done(); }); @@ -75,7 +73,7 @@ describe("fieldRange.vue", function() { trigger(input, "input"); vm.$nextTick( () => { - expect(model.rating).to.be.equal(6); + expect(model.rating).to.be.equal(6); done(); }); diff --git a/test/unit/specs/fields/fieldSelect.spec.js b/test/unit/specs/fields/fieldSelect.spec.js index 787035cb..da5dbcf3 100644 --- a/test/unit/specs/fields/fieldSelect.spec.js +++ b/test/unit/specs/fields/fieldSelect.spec.js @@ -42,7 +42,6 @@ describe("fieldSelect.vue", function() { expect(input).to.be.defined; expect(input.classList.contains("form-control")).to.be.true; - expect(input.disabled).to.be.false; }); it("should contain option elements", () => { @@ -62,13 +61,12 @@ describe("fieldSelect.vue", function() { it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal("Paris"); + expect(input.value).to.be.equal("Paris"); done(); }); }); describe("check optional attribute", () => { - // name which attributes you want to test and that's it. let attributes = ["disabled"]; attributes.forEach(function(name) { @@ -81,7 +79,7 @@ describe("fieldSelect.vue", function() { it("input value should be the model value after changed", (done) => { model.city = "Rome"; vm.$nextTick( () => { - expect(input.value).to.be.equal("Rome"); + expect(input.value).to.be.equal("Rome"); done(); }); @@ -92,7 +90,7 @@ describe("fieldSelect.vue", function() { trigger(input, "change"); vm.$nextTick( () => { - expect(model.city).to.be.equal("London"); + expect(model.city).to.be.equal("London"); done(); }); @@ -138,11 +136,11 @@ describe("fieldSelect.vue", function() { expect(options[2].textContent).to.be.equal("Paris"); expect(options[2].selected).to.be.true; expect(options[1].selected).to.be.false; - }); + }); it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal("2"); + expect(input.value).to.be.equal("2"); done(); }); }); @@ -150,7 +148,7 @@ describe("fieldSelect.vue", function() { it("input value should be the model value after changed", (done) => { model.city = 3; vm.$nextTick( () => { - expect(input.value).to.be.equal("3"); + expect(input.value).to.be.equal("3"); done(); }); @@ -161,7 +159,7 @@ describe("fieldSelect.vue", function() { trigger(input, "change"); vm.$nextTick( () => { - expect(model.city).to.be.equal(4); + expect(model.city).to.be.equal(4); done(); }); @@ -193,7 +191,7 @@ describe("fieldSelect.vue", function() { it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal("2"); + expect(input.value).to.be.equal("2"); done(); }); }); @@ -201,7 +199,7 @@ describe("fieldSelect.vue", function() { it("input value should be the model value after changed", (done) => { model.city = 3; vm.$nextTick( () => { - expect(input.value).to.be.equal("3"); + expect(input.value).to.be.equal("3"); done(); }); @@ -212,12 +210,12 @@ describe("fieldSelect.vue", function() { trigger(input, "change"); vm.$nextTick( () => { - expect(model.city).to.be.equal(4); + expect(model.city).to.be.equal(4); done(); }); }); - }); + }); }); \ No newline at end of file diff --git a/test/unit/specs/fields/fieldSelectEx.spec.js b/test/unit/specs/fields/fieldSelectEx.spec.js index 0a66e75d..de265595 100644 --- a/test/unit/specs/fields/fieldSelectEx.spec.js +++ b/test/unit/specs/fields/fieldSelectEx.spec.js @@ -41,8 +41,6 @@ describe("fieldSelectEx.vue", function() { expect(field.$el).to.be.exist; expect(input).to.be.defined; - // expect(input.disabled).to.be.false; - expect(input.multiple).to.be.false; }); it("should contain option elements", () => { @@ -58,17 +56,16 @@ describe("fieldSelectEx.vue", function() { let options = input.querySelectorAll("option"); expect(options[0].disabled).to.be.false; expect(options[0].textContent).to.be.equal(""); - }); + }); it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal("Paris"); + expect(input.value).to.be.equal("Paris"); done(); }); }); describe("check optional attribute", () => { - // name which attributes you want to test and that's it. let attributes = ["disabled", "multiSelect"]; attributes.forEach(function(name) { @@ -81,7 +78,7 @@ describe("fieldSelectEx.vue", function() { it("input value should be the model value after changed", (done) => { model.city = "Rome"; vm.$nextTick( () => { - expect(input.value).to.be.equal("Rome"); + expect(input.value).to.be.equal("Rome"); done(); }); @@ -92,7 +89,7 @@ describe("fieldSelectEx.vue", function() { trigger(input, "change"); vm.$nextTick( () => { - expect(model.city).to.be.equal("London"); + expect(model.city).to.be.equal("London"); done(); }); @@ -111,7 +108,7 @@ describe("fieldSelectEx.vue", function() { it("should not be multiple", (done) => { schema.multiSelect = true; vm.$nextTick( () => { - expect(input.multiple).to.be.true; + expect(input.multiple).to.be.true; let options = input.querySelectorAll("option"); expect(options.length).to.be.equal(4); // no @@ -149,11 +146,11 @@ describe("fieldSelectEx.vue", function() { expect(options[2].textContent).to.be.equal("Paris"); expect(options[2].selected).to.be.true; expect(options[1].selected).to.be.false; - }); + }); it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal("2"); + expect(input.value).to.be.equal("2"); done(); }); }); @@ -161,7 +158,7 @@ describe("fieldSelectEx.vue", function() { it("input value should be the model value after changed", (done) => { model.city = 3; vm.$nextTick( () => { - expect(input.value).to.be.equal("3"); + expect(input.value).to.be.equal("3"); done(); }); @@ -172,7 +169,7 @@ describe("fieldSelectEx.vue", function() { trigger(input, "change"); vm.$nextTick( () => { - expect(model.city).to.be.equal(4); + expect(model.city).to.be.equal(4); done(); }); @@ -204,7 +201,7 @@ describe("fieldSelectEx.vue", function() { it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal("2"); + expect(input.value).to.be.equal("2"); done(); }); }); @@ -212,7 +209,7 @@ describe("fieldSelectEx.vue", function() { it("input value should be the model value after changed", (done) => { model.city = 3; vm.$nextTick( () => { - expect(input.value).to.be.equal("3"); + expect(input.value).to.be.equal("3"); done(); }); @@ -223,12 +220,12 @@ describe("fieldSelectEx.vue", function() { trigger(input, "change"); vm.$nextTick( () => { - expect(model.city).to.be.equal(4); + expect(model.city).to.be.equal(4); done(); }); }); - }); + }); }); \ No newline at end of file diff --git a/test/unit/specs/fields/fieldSlider.spec.js b/test/unit/specs/fields/fieldSlider.spec.js index 001d1b75..0e90418b 100644 --- a/test/unit/specs/fields/fieldSlider.spec.js +++ b/test/unit/specs/fields/fieldSlider.spec.js @@ -39,21 +39,20 @@ describe("fieldSlider.vue", function() { expect(input).to.be.defined; expect(input.type).to.be.equal("text"); - expect(input.getAttribute("data-min")).to.be.equal("1"); - expect(input.getAttribute("data-max")).to.be.equal("10"); - expect(input.getAttribute("data-disable")).to.be.null; + expect(input.getAttribute("data-min")).to.be.equal("1"); + expect(input.getAttribute("data-max")).to.be.equal("10"); + expect(input.getAttribute("data-disable")).to.be.null; }); it("should contain the value", (done) => { vm.$nextTick( () => { - let origin = el.querySelector(".irs-slider.single"); + let origin = el.querySelector(".irs-slider.single"); expect(origin.style.left).to.be.within("70%", "90%"); done(); }); }); describe("check optional attribute", () => { - // name which attributes you want to test and that's it. let attributes = ["autocomplete", "placeholder", "readonly"]; attributes.forEach(function(name) { @@ -66,7 +65,7 @@ describe("fieldSlider.vue", function() { it("input value should be the model value after changed", (done) => { field.model = { rating: 3 }; vm.$nextTick( () => { - let origin = el.querySelector(".irs-slider.single"); + let origin = el.querySelector(".irs-slider.single"); expect(origin.style.left).to.be.within("20%", "40%"); done(); }); @@ -77,11 +76,11 @@ describe("fieldSlider.vue", function() { field.slider.update({ from: 6 }); field.slider.callOnChange(field.slider); // trigger changes vm.$nextTick( () => { - expect(field.model.rating).to.be.equal(6); + expect(field.model.rating).to.be.equal(6); done(); }); - }); + }); }); diff --git a/test/unit/specs/fields/fieldSpectrum.spec.js b/test/unit/specs/fields/fieldSpectrum.spec.js index dbde58f3..8d5a8025 100644 --- a/test/unit/specs/fields/fieldSpectrum.spec.js +++ b/test/unit/specs/fields/fieldSpectrum.spec.js @@ -38,19 +38,16 @@ describe("fieldSpectrum.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(field.picker.spectrum("get").toHexString()).to.be.equal("#ff8822"); + expect(field.picker.spectrum("get").toHexString()).to.be.equal("#ff8822"); 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) { @@ -63,7 +60,7 @@ describe("fieldSpectrum.vue", function() { it("input value should be the model value after changed", (done) => { field.model = { color: "#ffff00" }; vm.$nextTick( () => { - expect(field.picker.spectrum("get").toHexString()).to.be.equal("#ffff00"); + expect(field.picker.spectrum("get").toHexString()).to.be.equal("#ffff00"); done(); }); @@ -74,7 +71,7 @@ describe("fieldSpectrum.vue", function() { trigger(document.querySelector(".sp-input"), "change"); vm.$nextTick( () => { - expect(field.model.color).to.be.equal("#123456"); + expect(field.model.color).to.be.equal("#123456"); done(); }); diff --git a/test/unit/specs/fields/fieldStaticMap.spec.js b/test/unit/specs/fields/fieldStaticMap.spec.js index a610156a..3a9e1424 100644 --- a/test/unit/specs/fields/fieldStaticMap.spec.js +++ b/test/unit/specs/fields/fieldStaticMap.spec.js @@ -21,11 +21,11 @@ describe("fieldStaticMap.vue", function() { label: "Geo", model: "geo" }; - let model = { + let model = { geo: { lat: 13.4567, lng: 20.3321 - } + } }; let input; diff --git a/test/unit/specs/fields/fieldSubmit.spec.js b/test/unit/specs/fields/fieldSubmit.spec.js index 3300226d..e34b58f5 100644 --- a/test/unit/specs/fields/fieldSubmit.spec.js +++ b/test/unit/specs/fields/fieldSubmit.spec.js @@ -37,7 +37,7 @@ describe("fieldSubmit.vue", function() { expect(input).to.be.defined; expect(input.type).to.be.equal("submit"); - expect(input.value).to.be.equal("Submit form"); + expect(input.value).to.be.equal("Submit form"); }); it("should not call validate if validateBeforeSubmit is false", () => { @@ -46,11 +46,11 @@ describe("fieldSubmit.vue", function() { field.$parent.validate = cb; input.click(); - expect(cb.called).to.be.false; - expect(schema.onSubmit.calledOnce).to.be.true; - expect(schema.onSubmit.calledWith(model, schema)).to.be.true; + expect(cb.called).to.be.false; + expect(schema.onSubmit.calledOnce).to.be.true; + expect(schema.onSubmit.calledWith(model, schema)).to.be.true; }); - + it("should call validate if validateBeforeSubmit is true", () => { schema.validateBeforeSubmit = true; @@ -59,9 +59,9 @@ describe("fieldSubmit.vue", function() { field.$parent.validate = cb; input.click(); - expect(cb.called).to.be.true; - expect(schema.onSubmit.called).to.be.false; - }); + expect(cb.called).to.be.true; + expect(schema.onSubmit.called).to.be.false; + }); }); diff --git a/test/unit/specs/fields/fieldSwitch.spec.js b/test/unit/specs/fields/fieldSwitch.spec.js index db494896..3a90ae39 100644 --- a/test/unit/specs/fields/fieldSwitch.spec.js +++ b/test/unit/specs/fields/fieldSwitch.spec.js @@ -34,12 +34,12 @@ describe("FieldSwitch.vue", function() { expect(input).to.be.defined; expect(input.type).to.be.equal("checkbox"); - expect(input.disabled).to.be.false; + 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(); }); }); @@ -53,7 +53,7 @@ describe("FieldSwitch.vue", function() { it("should set disabled", (done) => { field.disabled = true; vm.$nextTick( () => { - expect(input.disabled).to.be.true; + expect(input.disabled).to.be.true; done(); }); }); @@ -61,7 +61,7 @@ describe("FieldSwitch.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(); }); @@ -72,7 +72,7 @@ describe("FieldSwitch.vue", function() { trigger(input, "change"); vm.$nextTick( () => { - expect(model.status).to.be.true; + expect(model.status).to.be.true; done(); }); @@ -121,7 +121,7 @@ describe("FieldSwitch.vue", function() { it("check input value", (done) => { vm.$nextTick( () => { - expect(input.checked).to.be.true; + expect(input.checked).to.be.true; done(); }); }); @@ -129,7 +129,7 @@ describe("FieldSwitch.vue", function() { it("input value should be the model value after changed", (done) => { model.sex = "male"; vm.$nextTick( () => { - expect(input.checked).to.be.false; + expect(input.checked).to.be.false; done(); }); @@ -140,11 +140,11 @@ describe("FieldSwitch.vue", function() { trigger(input, "change"); vm.$nextTick( () => { - expect(model.sex).to.be.equal("female"); + expect(model.sex).to.be.equal("female"); done(); }); - }); + }); }); diff --git a/test/unit/specs/fields/fieldText.spec.js b/test/unit/specs/fields/fieldText.spec.js index f7fa4ed7..92de28a1 100644 --- a/test/unit/specs/fields/fieldText.spec.js +++ b/test/unit/specs/fields/fieldText.spec.js @@ -38,20 +38,16 @@ describe("fieldText.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("John Doe"); + expect(input.value).to.be.equal("John Doe"); 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) { @@ -64,7 +60,7 @@ describe("fieldText.vue", function() { it("input value should be the model value after changed", (done) => { model.name = "Jane Doe"; vm.$nextTick( () => { - expect(input.value).to.be.equal("Jane Doe"); + expect(input.value).to.be.equal("Jane Doe"); done(); }); @@ -75,7 +71,7 @@ describe("fieldText.vue", function() { trigger(input, "input"); vm.$nextTick( () => { - expect(model.name).to.be.equal("John Smith"); + expect(model.name).to.be.equal("John Smith"); done(); }); diff --git a/test/unit/specs/fields/fieldTextArea.spec.js b/test/unit/specs/fields/fieldTextArea.spec.js index 2afa73e4..852f42b8 100644 --- a/test/unit/specs/fields/fieldTextArea.spec.js +++ b/test/unit/specs/fields/fieldTextArea.spec.js @@ -38,30 +38,26 @@ describe("fieldTextArea.vue", function() { expect(input).to.be.defined; 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; expect(input.rows).to.be.equal(2); // default value is 2 - expect(input.maxLength).to.be.equal(500); + expect(input.maxLength).to.be.equal(500); }); it("should change rows to 4", (done) => { field.$set("schema.rows", 4); // To be reactive vm.$nextTick( () => { - expect(input.rows).to.be.equal(4); + expect(input.rows).to.be.equal(4); done(); }); }); it("should contain the value", (done) => { vm.$nextTick( () => { - expect(input.value).to.be.equal(model.desc); + expect(input.value).to.be.equal(model.desc); done(); }); }); describe("check optional attribute", () => { - // name which attributes you want to test and that's it. let attributes = ["disabled", "placeholder", "readonly"]; attributes.forEach(function(name) { @@ -74,7 +70,7 @@ describe("fieldTextArea.vue", function() { it("input value should be the model value after changed", (done) => { model.desc = "Jane Doe"; vm.$nextTick( () => { - expect(input.value).to.be.equal("Jane Doe"); + expect(input.value).to.be.equal("Jane Doe"); done(); }); @@ -85,7 +81,7 @@ describe("fieldTextArea.vue", function() { trigger(input, "input"); vm.$nextTick( () => { - expect(model.desc).to.be.equal("John Smith"); + expect(model.desc).to.be.equal("John Smith"); done(); }); diff --git a/test/unit/specs/fields/fieldVueMultiSelect.spec.js b/test/unit/specs/fields/fieldVueMultiSelect.spec.js index 5f4cda32..09c2f578 100644 --- a/test/unit/specs/fields/fieldVueMultiSelect.spec.js +++ b/test/unit/specs/fields/fieldVueMultiSelect.spec.js @@ -47,8 +47,8 @@ describe("fieldVueMultiSelect.vue", function() { expect(input.classList.contains("multiselect--disabled")).to.be.false; }); - it("should contain option elements", () => { - let options = input.querySelectorAll("li.multiselect__option"); + it("should contain option elements", () => { + let options = input.querySelectorAll("li.multiselect__option"); expect(options.length).to.be.equal(schema.values.length); expect(options[1].querySelector("span").textContent).to.be.equal("Paris"); expect(options[1].classList.contains("multiselect__option--selected")).to.be.true; @@ -67,9 +67,9 @@ describe("fieldVueMultiSelect.vue", function() { model.city = "Rome"; vm.$nextTick( () => { expect(input.querySelectorAll("li.multiselect__option--selected").length).to.be.equal(1); - let options = input.querySelectorAll("li.multiselect__option"); + let options = input.querySelectorAll("li.multiselect__option"); expect(options[2].querySelector("span").textContent).to.be.equal("Rome"); - expect(options[2].classList.contains("multiselect__option--selected")).to.be.true; + expect(options[2].classList.contains("multiselect__option--selected")).to.be.true; done(); }); }); @@ -80,17 +80,17 @@ describe("fieldVueMultiSelect.vue", function() { expect(input.querySelectorAll("li.multiselect__option--selected").length).to.be.equal(2); let options = input.querySelectorAll("li.multiselect__option"); expect(options[1].querySelector("span").textContent).to.be.equal("Paris"); - expect(options[1].classList.contains("multiselect__option--selected")).to.be.true; + expect(options[1].classList.contains("multiselect__option--selected")).to.be.true; expect(options[2].querySelector("span").textContent).to.be.equal("Rome"); - expect(options[2].classList.contains("multiselect__option--selected")).to.be.true; + expect(options[2].classList.contains("multiselect__option--selected")).to.be.true; done(); }); }); it("model value should be the input value if changed", (done) => { let options = input.querySelectorAll("li.multiselect__option"); - trigger(options[2], "mousedown"); - + trigger(options[2], "mousedown"); + vm.$nextTick( () => { expect(model.city.length).to.be.equal(1); expect(model.city[0]).to.be.equal("Paris");