-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lionel Bijaoui
committed
Aug 8, 2016
1 parent
dba3ed7
commit f870dae
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { expect } from "chai"; | ||
import { createVueField } from "../util"; | ||
|
||
import Vue from "vue"; | ||
import fieldVueMultiSelect from "src/fields/fieldVueMultiSelect.vue"; | ||
|
||
Vue.component("fieldVueMultiSelect", fieldVueMultiSelect); | ||
|
||
// eslint-disable-next-line | ||
let el, vm, field; | ||
|
||
function createField(schema = {}, model = null, disabled = false, options) { | ||
[ el, vm, field ] = createVueField("fieldVueMultiSelect", schema, model, disabled, options); | ||
} | ||
|
||
describe("fieldVueMultiSelect.vue", () => { | ||
|
||
describe("check template", () => { | ||
let schema = { | ||
type: "vueMultiSelect", | ||
label: "Cities", | ||
model: "city", | ||
multiSelect: false, | ||
required: false, | ||
values: [ | ||
"London", | ||
"Paris", | ||
"Rome", | ||
"Berlin" | ||
] | ||
}; | ||
let model = { city: "Paris" }; | ||
let input; | ||
|
||
before( () => { | ||
createField(schema, model, false); | ||
input = el.getElementsByTagName("select")[0]; | ||
}); | ||
|
||
it("should contain a select element", () => { | ||
expect(field).to.be.exist; | ||
expect(field.$el).to.be.exist; | ||
|
||
expect(input).to.be.defined; | ||
// expect(input.classList.contains("form-control")).to.be.false; | ||
// expect(input.disabled).to.be.false; | ||
}); | ||
}); | ||
}); |