Set incoming props as variable names rather than values in test rendering to allow props to be properly passed to component under test

This commit is contained in:
tomdds
2019-07-11 17:52:54 -04:00
parent fd6ad924d9
commit 5234677ad3
3 changed files with 10 additions and 7 deletions

View File

@@ -33,10 +33,13 @@ const WrapperComponent = {
name: 'WrapperComponent',
components: { checkboxinput },
template: testTemplate,
props: {
initialChecked: Boolean,
},
data: function () {
return {
name: 'testCheck',
initialChecked: true
initialchecked: this.initialChecked
}
}
}
@@ -50,7 +53,7 @@ describe('CheckboxInput Renders Correctly', () => {
}
})
wrapper.vm.$children[0].$data.isChecked = true
// wrapper.vm.$children[0].$data.isChecked = true
expect(wrapper.find('.usa-input input').element.checked).toBe(true)
})