Fix uploader test and refactor makeTestWrapper to accept data fn

This commit is contained in:
richard-dds
2019-08-05 11:19:21 -04:00
parent 3d414e1a60
commit 81a478915d
7 changed files with 69 additions and 27 deletions

View File

@@ -16,7 +16,7 @@ to be passed as a prop to checkboxinput at mount time
v-bind:initial-checked='initialvalue'
>
*/
const makeTestWrapper = ({ components, templatePath }) => {
const makeTestWrapper = ({ components, templatePath, data }) => {
const templateString = fs.readFileSync(
`js/test_templates/${templatePath}`,
'utf-8'
@@ -27,11 +27,7 @@ const makeTestWrapper = ({ components, templatePath }) => {
components,
template: templateString,
props: ['initialData'],
data: function() {
return {
initialvalue: this.initialData,
}
},
data,
}
return WrapperComponent