const Component = Vue.extend(c);
const vm = new Component();
const vm = avoriaz.mount(c);
const vm = vueTest.mount(c);
t.beforeEach(vueUnit.beforeEachHooks);
vueUnit.mount(c);
t.afterEach(vueUnit.afterEachHooks);
const vm = vuenit.mount(c);
t.is(vm.foo, 'foo');
t.is(vm.computed().foo(), 'foo');
???
t.is(vm.foo, 'foo');
t.is(vm.foo, 'foo');
t.is(vm.foo(), 'foo');
t.is(vm.methods().foo(), 'foo');
???
t.is(vm.foo(), 'foo');
t.is(vm.foo(), 'foo');
t.is(vm.foo, 'foo');
t.is(vm.data().foo, 'foo');
???
t.is(vm.foo, 'foo');
t.is(vm.foo, 'foo');
vm.foo = 'bah';
t.is(vm.foo, 'bah');
vm.setData({ foo : 'bah' });
t.is(vm.data().foo, 'bah');
???
vm.foo = 'bah';
t.is(vm.foo, 'bah');
vm.foo = 'bah';
t.is(vm.foo, 'bah');
const Component = Vue.extend(c);
const vm = new Component({
propsData : {
foo : 'bah'
}
});
const vm = avoriaz.mount(c, {
propsData : {
foo : 'bah'
}
});
???
const vm = vueUnit.mount(c, {
props : {
foo : 'bah'
}
});
const vm = vuenit.component(c, {
props : {
foo : 'bah'
}
});
t.is(vm.foo, 'foo');
t.is(vm.propsData().foo, 'foo');
???
t.is(vm.foo, 'foo');
t.is(vm.foo, 'foo');
???
???
???
???
vm.propsData.foo = 'bah';
await vm.$nextTick();
t.is(vm.foo, 'bah');
???
???
???
const vm = vueUnit.component(c, {
slots : {
header : '<h1>Header</h1>'
default : '<div>Body</div>',
footer : '<h4>Footer</h4>'
}
});
const vm = vuenit.component(c, {
slots : {
header : '<h1>Header</h1>'
default : '<div>Body</div>',
footer : '<h4>Footer</h4>'
}
});
t.is(vm.$options.name, 'Foo');
t.is(vm.name(), 'Foo');
t.is(vm.$options.name, 'Foo');
t.is(vm.$options.name, 'Foo');
t.is(vm.$name, 'Foo');
vm.$emit('click', {});
vm.simulate('click'); // cannot attach a payload...
vm.trigger('click');
vm.$emit('click', {});
vm.$emit('click', {});
vm.$el.querySelector('button').dispatchEvent(new Event('click'));
vm.find('button')[0].simulate('click');
vm.trigger('click');
vm.$el.querySelector('button').dispatchEvent(new Event('click'));
vm.$find('button').$trigger('click');
vm.$on('customEvent', spy);
???
???
vm.$on('customEvent', spy);
vm.$on('customEvent', spy);
// or
vuenit.component(c, {
on : {
customEvent : spy
}
});
???
vm.find(MyComponent);
???
???
vm.$find(MyComponent);
vm.$find('myComponent');
vm.$el.querySelector('.myClass');
vm.find('.myClass');
vm.find('.myClass');
vm.$el.querySelector('.myClass');
vm.$find('.myClass');
???
t.true(vm.contains(Component));
???
???
t.true(vm.$contains(Component));
t.truthy(vm.$el.querySelector('.myClass'));
t.true(vm.contains('.myClass'));
t.true(vm.contains('.myClass'));
t.truthy(vm.$el.querySelector('.myClass'));
t.true(vm.$contains('.myClass'));
t.is(vm.$el.getAttribute('id'), 'foo');
t.true(vm.hasAttribute('id', 'foo'));
???
t.is(vm.$el.getAttribute('id'), 'foo');
t.is(vm.$el.getAttribute('id'), 'foo');
t.is(vm.$el.querySelector('.myClass').getAttribute('id'), 'foo');
t.true(vm.find('.myClass')[0].hasAttribute('id', 'foo'));
t.true(vm.find('.myClass')[0].getAttribute('id'), 'foo');
t.is(vm.$el.querySelector('.myClass').getAttribute('id'), 'foo');
t.is(vm.$find('.myClass').getAttribute('id'), 'foo');
t.true(vm.$el.classList.contains('myClass'));
t.true(vm.hasClass('myClass'));
t.true(vm.hasClass('myClass'));
t.true(vm.$el.classList.contains('myClass'));
t.true(vm.$el.classList.contains('myClass'));
t.true(vm.$el.querySelector('.myClass').classList.contains('myClass'));
### avoriaz
t.true(vm.find('.myClass')[0].hasClass('myClass')); // possibly a redundant test!
???
t.true(vm.$el.querySelector('.myClass').classList.contains('myClass'));
t.true(vm.$find('.myClass').classList.contains('myClass'));
t.is(vm.$el.style.width, '100%');
t.true(vm.hasStyle('width', '100%'));
???
t.is(vm.$el.style.width, '100%');
t.is(vm.$el.style.width, '100%');
t.is(vm.$el.querySelector('.myClass').style.width, '100%');
### avoriaz
t.true(vm.find('.myClass').hasStyle('width', '100%'));
???
t.is(vm.$el.querySelector('.myClass').style.width, '100%');
t.is(vm.$find('.myClass').style.width, '100%');
t.is(vm.$el.outerHTML, '<div/>');
t.is(vm.html(), '<div/>');
t.is(vm.html(), '<div/>');
t.is(vm.$el.outerHTML, '<div/>');
t.is(vm.$html, '<div/>');
t.is(vm.$el.tagName, 'DIV');
t.true(vm.is('div'));
t.true(vm.matches('div'));
t.is(vm.$el.tagName, 'DIV');
t.is(vm.$el.tagName, 'DIV');
t.is(vm.$el.children.length, 0);
t.true(vm.isEmpty());
t.true(vm.isEmpty());
t.is(vm.$el.children.length, 0);
t.is(vm.$el.children.length, 0);
???
???
???
???
const vm = vuenit.component(c, {
inject : { $store, $route, service }
});
???
???
???
var vm = vuenit.component(c, {
components : {
myComponent : '<span>mock content</span>'
}
});
???
???
???
var vm = vuenit.shallow(c);