-
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
Showing
4 changed files
with
75 additions
and
26 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
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,50 @@ | ||
import { expect } from "chai"; | ||
|
||
import Vue from "vue"; | ||
import VueFormGenerator from "src/index"; | ||
|
||
function createFormGenerator(schema, model, options, done) { | ||
let el = document.createElement("div"); | ||
el.innerHTML = `<vue-form-generator :schema="schema" :model="model" :options="options"></vue-form-generator>`; | ||
|
||
let vm = new Vue({ | ||
el: el, | ||
data: { | ||
schema, | ||
model, | ||
options | ||
} | ||
}); | ||
|
||
vm.$nextTick(() => { | ||
console.log(el); | ||
done(el, vm); | ||
}); | ||
} | ||
|
||
describe("VueFormGenerator.vue", () => { | ||
|
||
let el, vm; | ||
|
||
Vue.component("VueFormGenerator", VueFormGenerator.component); | ||
|
||
beforeEach((done) => { | ||
createFormGenerator({}, null, {}, (_el, _vm) => { | ||
el = _el; | ||
vm = _vm; | ||
done(); | ||
}); | ||
}); | ||
|
||
it("should be create HTML divs", () => { | ||
expect(vm.$el).to.be.exist; | ||
expect(el.getElementsByTagName("table")).to.be.length(1); | ||
|
||
let table = el.getElementsByTagName("table")[0]; | ||
|
||
}); | ||
|
||
|
||
|
||
|
||
}); |
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
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