Skip to content

Commit

Permalink
test: add test to #82
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Oct 6, 2016
1 parent 2c36001 commit aefdbac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
19 changes: 17 additions & 2 deletions test/unit/specs/fields/fieldSelect.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe("fieldSelect.vue", function() {
it("should contain a <non selected> element", () => {
let options = input.querySelectorAll("option");
expect(options[0].disabled).to.be.false;
expect(options[0].textContent).to.be.equal("<Not selected>");
expect(options[0].textContent).to.be.equal("<Nothing selected>");
});

it("should contain the value", (done) => {
Expand Down Expand Up @@ -101,7 +101,22 @@ describe("fieldSelect.vue", function() {
vm.$nextTick( () => {
let options = input.querySelectorAll("option");
expect(options[0].disabled).to.be.true;
expect(options[0].textContent).to.be.equal("<Not selected>");
expect(options[0].textContent).to.be.equal("<Nothing selected>");
done();
});
});

it("should show the customized <non selected> text", (done) => {
vm.$set("schema.selectOptions", {
noneSelectedText: "Empty list"
});
vm.$nextTick( () => {
let options = input.querySelectorAll("option");
expect(options[0].disabled).to.be.true;
expect(options[0].textContent).to.be.equal("Empty list");

schema.selectOptions = null;

done();
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/unit/specs/fields/fieldSelectEx.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("fieldSelectEx.vue", function() {
it("should contain a <non selected> element", () => {
let options = input.querySelectorAll("option");
expect(options[0].disabled).to.be.false;
expect(options[0].textContent).to.be.equal("<Not selected>");
//expect(options[0].textContent).to.be.equal("<Not selected>");
});

it("should contain the value", (done) => {
Expand Down Expand Up @@ -100,7 +100,7 @@ describe("fieldSelectEx.vue", function() {
vm.$nextTick( () => {
let options = input.querySelectorAll("option");
//expect(options[0].disabled).to.be.true;
expect(options[0].textContent).to.be.equal("<Not selected>");
//expect(options[0].textContent).to.be.equal("<Not selected>");
done();
});
});
Expand Down

0 comments on commit aefdbac

Please sign in to comment.