Open hosein2398 opened 6 years ago
Hey, I'm using Avoriaz with AVA and I've written some tests so far. In one test I'm trying to get data() of a component but it returns empty object. data of my component :
data
data() { return { defaultStyle: 'transition: ' + this.timer + 's;', currentWord: this.data[0], liStl: null, dataCounter: 0, displayState: "shown", filters: { 'simple': ["opacity:0", "opacity:1"], 'bottom-top': ["transform:translateY(10px);opacity:0;", "transform:translateY(0px);opacity:1;"], 'top-bottom': ["transform:translateY(-10px);opacity:0;", "transform:translateY(0px);opacity:1;"], 'right-left': ["transform:translateX(10px);opacity:0;", "transform:translateX(0px);opacity:1;"], 'left-right': ["transform:translateX(-10px);opacity:0;", "transform:translateX(0px);opacity:1;"], 'press': ["letter-spacing: 4px;opacity:0;", "opacity:1;"], 'scale': ["transform:scaleY(1.4);opacity:0;", "opacity:1;"], 'flash': ["transform:skewX(-70deg);opacity:0;", "transform:skewX(0deg);opacity:1;"], 'flip': ["transform:rotateX(-180deg);opacity:0;", "transform:rotate(0deg);opacity:1;"], } } },
and this.data[0] is prop if you wonder. And here is test:
this.data[0]
test('Checks existence some of data', (t) => { t.plan(2); const datas = wrapper.data(); t.is(datas.dataCounter , 0); t.is(datas.displayState , 'shown'); });
Thanks for the bug report.
What Vue version are you using?
I'm using
"vue": "^2.5.11" "ava": "^0.25.0" "avoriaz": "^6.3.0"
Hey, I'm using Avoriaz with AVA and I've written some tests so far. In one test I'm trying to get data() of a component but it returns empty object.
data
of my component :and
this.data[0]
is prop if you wonder. And here is test: