Skip to content

Commit fab13aa

Browse files
committed
extra updates to the test layout
1 parent 2a10fc8 commit fab13aa

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-formly-bootstrap",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "A bootstrap based form input bundle for Vue Formly",
55
"main": "dist/vue-formly-bootstrap.js",
66
"scripts": {

test/unit/specs/index.spec.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,21 @@ function describeAttributes(inputElement, exclude = []){
146146
};
147147

148148
function describeConditional(inputElement){
149-
it('label', () => {
149+
it('label', (done) => {
150150
data.form.test.type = inputElement;
151151
data.form.test.inputType = 'text';
152152
data.form.test.label = '';
153153
createForm(data);
154154

155155
expect(vm.$el.querySelectorAll('label')).to.be.length(0);
156+
157+
vm.form.test.label = 'testing';
158+
159+
setTimeout(()=>{
160+
expect(vm.$el.querySelectorAll('label')).to.be.length(1);
161+
expect(vm.$el.querySelectorAll('label')[0].innerHTML).to.equal('testing');
162+
done();
163+
},0);
156164
});
157165
};
158166

@@ -193,9 +201,6 @@ describe('Bootstrap Field Inputs', () => {
193201
expect(inputs).to.be.length(1);
194202
expect(input.type).to.equal('text');
195203
expect(input.className).to.equal('form-control');
196-
197-
expect(labels).to.be.length(1);
198-
expect(label.textContent).to.equal(data.form.test.label);
199204

200205
vm.form.test.value = 'testing';
201206

@@ -219,6 +224,16 @@ describe('Bootstrap Field Inputs', () => {
219224
describe('conditional elements', ()=>{
220225
describeConditional('select');
221226
});
227+
228+
it('layout', () => {
229+
data.form.test.type = 'select';
230+
createForm(data);
231+
232+
let inputs = vm.$el.querySelectorAll('select');
233+
let input = inputs[0];
234+
235+
expect(inputs).to.be.length(1);
236+
});
222237

223238
});
224239

0 commit comments

Comments
 (0)