modify tests so we can add new things i.e. preload

pull/1864/head
Rich Harris 7 years ago
parent 13def49a46
commit 366bf0706a

@ -162,7 +162,13 @@ describe.only("runtime", () => {
} }
if (config.test) { if (config.test) {
return Promise.resolve(config.test(assert, component, target, window, raf)).then(() => { return Promise.resolve(config.test({
assert,
component,
target,
window,
raf
})).then(() => {
component.$destroy(); component.$destroy();
}); });
} else { } else {

@ -8,7 +8,7 @@ export default {
<p>second: </p> <p>second: </p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const event = new window.MouseEvent('click'); const event = new window.MouseEvent('click');
const buttons = target.querySelectorAll('button'); const buttons = target.querySelectorAll('button');

@ -8,7 +8,7 @@ export default {
<p>fromState: </p> <p>fromState: </p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const event = new window.MouseEvent('click'); const event = new window.MouseEvent('click');
const buttons = target.querySelectorAll('button'); const buttons = target.querySelectorAll('button');

@ -3,7 +3,7 @@ export default {
html: '<button>10</button>', html: '<button>10</button>',
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const event = new window.MouseEvent('click'); const event = new window.MouseEvent('click');
const button = target.querySelector('button'); const button = target.querySelector('button');

@ -1,7 +1,7 @@
export default { export default {
html: `<input>`, html: `<input>`,
test(assert, component, target, window) { test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
const event = new window.KeyboardEvent('keydown', { const event = new window.KeyboardEvent('keydown', {
which: 13 which: 13

@ -1,7 +1,7 @@
export default { export default {
html: '<button>???</button>', html: '<button>???</button>',
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const event = new window.MouseEvent('click', { const event = new window.MouseEvent('click', {
clientX: 42, clientX: 42,
clientY: 42 clientY: 42

@ -1,7 +1,7 @@
export default { export default {
html: '<button>0, 0</button>', html: '<button>0, 0</button>',
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const event = new window.MouseEvent('click', { const event = new window.MouseEvent('click', {
clientX: 42, clientX: 42,
clientY: 42 clientY: 42

@ -3,7 +3,7 @@ export default {
<button>action</button> <button>action</button>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const button = target.querySelector('button'); const button = target.querySelector('button');
const eventEnter = new window.MouseEvent('mouseenter'); const eventEnter = new window.MouseEvent('mouseenter');
const eventLeave = new window.MouseEvent('mouseleave'); const eventLeave = new window.MouseEvent('mouseleave');

@ -8,7 +8,7 @@ export default {
<h1></h1> <h1></h1>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const header = target.querySelector('h1'); const header = target.querySelector('h1');
const click = new window.MouseEvent('click'); const click = new window.MouseEvent('click');

@ -1,5 +1,5 @@
export default { export default {
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const button = target.querySelector('button'); const button = target.querySelector('button');
const click = new window.MouseEvent('click'); const click = new window.MouseEvent('click');

@ -3,7 +3,7 @@ export default {
<button>action</button> <button>action</button>
`, `,
async test (assert, component, target, window) { async test({ assert, component, target, window }) {
const button = target.querySelector('button'); const button = target.querySelector('button');
const enter = new window.MouseEvent('mouseenter'); const enter = new window.MouseEvent('mouseenter');
const leave = new window.MouseEvent('mouseleave'); const leave = new window.MouseEvent('mouseleave');

@ -3,7 +3,7 @@ export default {
<button>action</button> <button>action</button>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const button = target.querySelector('button'); const button = target.querySelector('button');
const eventEnter = new window.MouseEvent('mouseenter'); const eventEnter = new window.MouseEvent('mouseenter');
const eventLeave = new window.MouseEvent('mouseleave'); const eventLeave = new window.MouseEvent('mouseleave');

@ -10,7 +10,7 @@ export default {
<p>hello!</p> <p>hello!</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
component.value = 'goodbye!'; component.value = 'goodbye!';
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `
<p>goodbye!</p> <p>goodbye!</p>

@ -10,7 +10,7 @@ export default {
<p>hello!</p> <p>hello!</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
component.value = 'goodbye!'; component.value = 'goodbye!';
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `
<p>goodbye!</p> <p>goodbye!</p>

@ -17,7 +17,7 @@ export default {
<div>e</div> <div>e</div>
`, `,
test(assert, component, target, window, raf) { test({ assert, component, target, window, raf }) {
let divs = document.querySelectorAll('div'); let divs = document.querySelectorAll('div');
divs.forEach(div => { divs.forEach(div => {
div.getBoundingClientRect = function() { div.getBoundingClientRect = function() {

@ -17,7 +17,7 @@ export default {
<div>e</div> <div>e</div>
`, `,
test(assert, component, target, window, raf) { test({ assert, component, target, window, raf }) {
let divs = document.querySelectorAll('div'); let divs = document.querySelectorAll('div');
divs.forEach(div => { divs.forEach(div => {
div.getBoundingClientRect = function() { div.getBoundingClientRect = function() {

@ -17,7 +17,7 @@ export default {
<div>e</div> <div>e</div>
`, `,
test(assert, component, target, window, raf) { test({ assert, component, target, window, raf }) {
let divs = document.querySelectorAll('div'); let divs = document.querySelectorAll('div');
divs.forEach(div => { divs.forEach(div => {
div.getBoundingClientRect = function() { div.getBoundingClientRect = function() {

@ -1,6 +1,6 @@
export default { export default {
html: `<textarea></textarea>`, html: `<textarea></textarea>`,
test (assert, component, target) { test({ assert, component, target }) {
const textarea = target.querySelector('textarea'); const textarea = target.querySelector('textarea');
assert.ok(textarea.readOnly === false); assert.ok(textarea.readOnly === false);
}, },

@ -11,7 +11,7 @@ export default {
<input type='checkbox'> <input type='checkbox'>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.ok(input.indeterminate); assert.ok(input.indeterminate);

@ -1,6 +1,6 @@
export default { export default {
html: `<textarea readonly></textarea>`, html: `<textarea readonly></textarea>`,
test (assert, component, target) { test({ assert, component, target }) {
const textarea = target.querySelector('textarea'); const textarea = target.querySelector('textarea');
assert.ok(textarea.readOnly); assert.ok(textarea.readOnly);
}, },

@ -11,7 +11,7 @@ export default {
</svg> </svg>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
const attr = sel => target.querySelector(sel).attributes[0].name; const attr = sel => target.querySelector(sel).attributes[0].name;
assert.equal(attr('div'), 'class'); assert.equal(attr('div'), 'class');

@ -1,7 +1,7 @@
export default { export default {
html: `<div id="foo"></div>`, html: `<div id="foo"></div>`,
test ( assert, component, target ) { test({ assert, component, target }) {
component.id = 'bar'; component.id = 'bar';
assert.equal( target.innerHTML, `<div id="bar"></div>` ); assert.equal( target.innerHTML, `<div id="bar"></div>` );
} }

@ -8,7 +8,7 @@ export default {
html: `<input type="text">`, html: `<input type="text">`,
test(assert, component, target) { test({ assert, component, target }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.type, 'text'); assert.equal(input.type, 'text');
assert.equal(input.value, '42'); assert.equal(input.value, '42');

@ -1,7 +1,7 @@
export default { export default {
html: `<div style="color: red;">red</div>`, html: `<div style="color: red;">red</div>`,
test ( assert, component, target ) { test({ assert, component, target }) {
const div = target.querySelector( 'div' ); const div = target.querySelector( 'div' );
assert.equal( div.style.color, 'red' ); assert.equal( div.style.color, 'red' );

@ -7,7 +7,7 @@ export default {
</svg> </svg>
`, `,
test ( assert, component, target ) { test({ assert, component, target }) {
const use = target.querySelector( 'use' ); const use = target.querySelector( 'use' );
assert.equal( use.getAttributeNS( 'http://www.w3.org/1999/xlink', 'href' ), '#bar' ); assert.equal( use.getAttributeNS( 'http://www.w3.org/1999/xlink', 'href' ), '#bar' );
} }

@ -5,7 +5,7 @@ export default {
foo: false, foo: false,
}, },
test(assert, component, target) { test({ assert, component, target }) {
const inputs = target.querySelectorAll('input'); const inputs = target.querySelectorAll('input');
assert.ok(inputs[0].checked); assert.ok(inputs[0].checked);

@ -1,6 +1,6 @@
export default { export default {
html: `<textarea readonly=""></textarea>`, html: `<textarea readonly=""></textarea>`,
test ( assert, component, target ) { test({ assert, component, target }) {
const textarea = target.querySelector( 'textarea' ); const textarea = target.querySelector( 'textarea' );
assert.ok( textarea.readOnly ); assert.ok( textarea.readOnly );
} }

@ -1,7 +1,7 @@
export default { export default {
html: '', html: '',
test(assert, component, target, window) { test({ assert, component, target, window }) {
component.visible = true; component.visible = true;
assert.equal(target.querySelector('input'), window.document.activeElement); assert.equal(target.querySelector('input'), window.document.activeElement);
} }

@ -5,7 +5,7 @@ export default {
promise promise
}, },
test(assert, component, target) { test({ assert, component, target }) {
return promise.then(() => { return promise.then(() => {
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `
<p>42</p> <p>42</p>

@ -18,7 +18,7 @@ export default {
<p>a title: loading...</p> <p>a title: loading...</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
fulfil(42); fulfil(42);
return thePromise return thePromise

@ -1,5 +1,5 @@
export default { export default {
test(assert, component, target) { test({ assert, component, target }) {
const promise = Promise.resolve().then(() => { const promise = Promise.resolve().then(() => {
component.answer = 42; component.answer = 42;
}); });

@ -13,7 +13,7 @@ export default {
<div><p>loading...</p></div> <div><p>loading...</p></div>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
fulfil(42); fulfil(42);
return thePromise return thePromise

@ -12,7 +12,7 @@ export default {
<p>loading...</p> <p>loading...</p>
`, `,
test(assert, component, target, window) { test({ assert, component, target, window }) {
fulfil(42); fulfil(42);
return thePromise return thePromise

@ -14,7 +14,7 @@ export default {
<p>loading...</p> <p>loading...</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
fulfil(42); fulfil(42);
return thePromise return thePromise

@ -13,7 +13,7 @@ export default {
<p>loading...</p> <p>loading...</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
fulfil(42); fulfil(42);
return thePromise return thePromise

@ -14,7 +14,7 @@ export default {
<p>loading...</p> <p>loading...</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
fulfil(42); fulfil(42);
return thePromise return thePromise

@ -11,7 +11,7 @@ export default {
html: `waiting`, html: `waiting`,
test(assert, component, target) { test({ assert, component, target }) {
fulfil(9000); fulfil(9000);
return thePromise return thePromise

@ -7,7 +7,7 @@ export default {
<p>the value is not actually a promise</p> <p>the value is not actually a promise</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
component.thePromise = 'still not a promise'; component.thePromise = 'still not a promise';
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `

@ -13,7 +13,7 @@ export default {
<p>loading...</p> <p>loading...</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
fulfil(42); fulfil(42);
return promise return promise

@ -13,7 +13,7 @@ export default {
<p>loading...</p> <p>loading...</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
fulfil(42); fulfil(42);
return thePromise return thePromise

@ -11,7 +11,7 @@ export default {
html: ``, html: ``,
test(assert, component, target) { test({ assert, component, target }) {
fulfil(42); fulfil(42);
return thePromise return thePromise

@ -7,7 +7,7 @@ export default {
<span>1</span> <span>1</span>
`, `,
async test(assert, component, target) { async test({ assert, component, target }) {
await component.list.update(); await component.list.update();
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `

@ -10,7 +10,7 @@ export default {
<p>hello!</p> <p>hello!</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
component.value = 'goodbye!'; component.value = 'goodbye!';
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `
<p>goodbye!</p> <p>goodbye!</p>

@ -4,7 +4,7 @@ export default {
// instead // instead
skip: true, skip: true,
test(assert, component, target, window) { test({ assert, component, target, window }) {
assert.equal(component.t, 0); assert.equal(component.t, 0);
assert.equal(component.d, 0); assert.equal(component.d, 0);
assert.equal(component.v, 0.5); assert.equal(component.v, 0.5);

@ -11,7 +11,7 @@ export default {
</select> </select>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const select = target.querySelector('select'); const select = target.querySelector('select');
const options = target.querySelectorAll('option'); const options = target.querySelectorAll('option');

@ -32,7 +32,7 @@ export default {
<p>shake it all about</p> <p>shake it all about</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
const select = target.querySelector('select'); const select = target.querySelector('select');
const options = target.querySelectorAll('option'); const options = target.querySelectorAll('option');

@ -33,7 +33,7 @@ export default {
<p>1 completed</p> <p>1 completed</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const inputs = [ ...target.querySelectorAll('input') ]; const inputs = [ ...target.querySelectorAll('input') ];
assert.ok(inputs[0].checked); assert.ok(inputs[0].checked);

@ -25,7 +25,7 @@ export default {
<p>Beta</p>`, <p>Beta</p>`,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input'); const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false); assert.equal(inputs[0].checked, false);
assert.equal(inputs[1].checked, true); assert.equal(inputs[1].checked, true);

@ -25,7 +25,7 @@ export default {
<p>Beta</p>`, <p>Beta</p>`,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input'); const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false); assert.equal(inputs[0].checked, false);
assert.equal(inputs[1].checked, true); assert.equal(inputs[1].checked, true);

@ -11,7 +11,7 @@ export default {
<p>indeterminate? true</p> <p>indeterminate? true</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.checked, false); assert.equal(input.checked, false);
assert.equal(input.indeterminate, true); assert.equal(input.indeterminate, true);

@ -17,7 +17,7 @@ export default {
<input type="checkbox"> <input type="checkbox">
`, `,
test(assert, component, target, window) { test({ assert, component, target, window }) {
const { cats } = component; const { cats } = component;
const newCats = cats.slice(); const newCats = cats.slice();
newCats.push({ newCats.push({

@ -13,7 +13,7 @@ export default {
<p>true</p> <p>true</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.checked, true); assert.equal(input.checked, true);

@ -13,7 +13,7 @@ export default {
<p>number 42</p> <p>number 42</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.value, '42'); assert.equal(input.value, '42');

@ -25,7 +25,7 @@ export default {
<p>Beta</p>`, <p>Beta</p>`,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input'); const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false); assert.equal(inputs[0].checked, false);
assert.equal(inputs[1].checked, true); assert.equal(inputs[1].checked, true);

@ -13,7 +13,7 @@ export default {
<p>number 42</p> <p>number 42</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.value, '42'); assert.equal(input.value, '42');

@ -13,7 +13,7 @@ export default {
<p>number 42</p> <p>number 42</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.value, '42'); assert.equal(input.value, '42');

@ -27,7 +27,7 @@ export default {
</div> </div>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const inputs = [...target.querySelectorAll('input')]; const inputs = [...target.querySelectorAll('input')];
const items = component.items; const items = component.items;
const event = new window.Event('input'); const event = new window.Event('input');

@ -15,7 +15,7 @@ export default {
<input value=world> <input value=world>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.value, 'world'); assert.equal(input.value, 'world');

@ -18,7 +18,7 @@ export default {
<pre>{"foo":"a","bar":"b","baz":"c"}</pre> <pre>{"foo":"a","bar":"b","baz":"c"}</pre>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
const event = new window.Event('input'); const event = new window.Event('input');

@ -16,7 +16,7 @@ export default {
<p>hello alice</p> <p>hello alice</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.value, 'alice'); assert.equal(input.value, 'alice');

@ -20,7 +20,7 @@ export default {
<pre>{"foo":"a","bar":"b","baz":"c"}</pre> <pre>{"foo":"a","bar":"b","baz":"c"}</pre>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
const event = new window.Event('input'); const event = new window.Event('input');

@ -19,7 +19,7 @@ export default {
<div><input value=three><p>three</p></div> <div><input value=three><p>three</p></div>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const inputs = [...target.querySelectorAll('input')]; const inputs = [...target.querySelectorAll('input')];
assert.equal(inputs[0].value, 'one'); assert.equal(inputs[0].value, 'one');

@ -15,7 +15,7 @@ export default {
<p>hello alice</p> <p>hello alice</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.value, 'alice'); assert.equal(input.value, 'alice');

@ -13,7 +13,7 @@ export default {
<p>hello world</p> <p>hello world</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.value, 'world'); assert.equal(input.value, 'world');

@ -3,7 +3,7 @@ export default {
a: 42 a: 42
}, },
test(assert, component, target, window) { test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
assert.equal(input.value, '42'); assert.equal(input.value, '42');

@ -24,7 +24,7 @@ export default {
<p>foo: 2</p> <p>foo: 2</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const select = target.querySelector('select'); const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')]; const options = [...target.querySelectorAll('option')];

@ -17,7 +17,7 @@ export default {
items: [{ value: 'hullo' }, { value: 'world' }] items: [{ value: 'hullo' }, { value: 'world' }]
}, },
test(assert, component, target, window) { test({ assert, component, target, window }) {
const selects = [...target.querySelectorAll('select')]; const selects = [...target.querySelectorAll('select')];
const change = new window.Event('change'); const change = new window.Event('change');

@ -5,7 +5,7 @@ export default {
letter: 'b' letter: 'b'
}, },
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
await component.modal.toggle(); await component.modal.toggle();
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `

@ -13,7 +13,7 @@ export default {
<p>selected: a</p> <p>selected: a</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
const select = target.querySelector('select'); const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')]; const options = [...target.querySelectorAll('option')];

@ -27,7 +27,7 @@ export default {
selected: 'b', selected: 'b',
}, },
test(assert, component, target) { test({ assert, component, target }) {
const select = target.querySelector('select'); const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')]; const options = [...target.querySelectorAll('option')];

@ -9,7 +9,7 @@ export default {
<p>selected: nothing</p> <p>selected: nothing</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
component.items = [ 'one', 'two', 'three' ]; component.items = [ 'one', 'two', 'three' ];
component.selected = 'two'; component.selected = 'two';

@ -15,7 +15,7 @@ export default {
<p>selected: two, three</p> <p>selected: two, three</p>
`, `,
test ( assert, component, target, window ) { test({ assert, component, target, window }) {
const select = target.querySelector( 'select' ); const select = target.querySelector( 'select' );
const options = [ ...target.querySelectorAll( 'option' ) ]; const options = [ ...target.querySelectorAll( 'option' ) ];

@ -12,7 +12,7 @@ export default {
</select> </select>
`, `,
test(assert, component, target, window) { test({ assert, component, target, window }) {
const select = target.querySelector('select'); const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')]; const options = [...target.querySelectorAll('option')];

@ -27,7 +27,7 @@ export default {
selected: 'one', selected: 'one',
}, },
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const select = target.querySelector('select'); const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')]; const options = [...target.querySelectorAll('option')];

@ -13,7 +13,7 @@ export default {
<p>some text</p> <p>some text</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const textarea = target.querySelector('textarea'); const textarea = target.querySelector('textarea');
assert.equal(textarea.value, 'some text'); assert.equal(textarea.value, 'some text');

@ -1,5 +1,5 @@
export default { export default {
test(assert, component) { test({ assert, component }) {
assert.equal(component.one.snapshot, 2); assert.equal(component.one.snapshot, 2);
} }
}; };

@ -1,5 +1,5 @@
export default { export default {
async test(assert, component) { async test({ assert, component }) {
const { foo, p } = component; const { foo, p } = component;
const values = []; const values = [];

@ -5,7 +5,7 @@ export default {
html: `<div class="active"></div>`, html: `<div class="active"></div>`,
test(assert, component, target, window) { test({ assert, component, target, window }) {
component.user = { active: false }; component.user = { active: false };
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `

@ -10,7 +10,7 @@ export default {
<div></div> <div></div>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
component.selected = 'three'; component.selected = 'three';
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `
<div></div> <div></div>

@ -7,7 +7,7 @@ export default {
html: `<div class="one two foo bar"></div>`, html: `<div class="one two foo bar"></div>`,
test(assert, component, target, window) { test({ assert, component, target, window }) {
component.foo = false; component.foo = false;
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `

@ -6,7 +6,7 @@ export default {
html: `<div class="foo bar"></div>`, html: `<div class="foo bar"></div>`,
test(assert, component, target, window) { test({ assert, component, target, window }) {
component.foo = false; component.foo = false;
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `

@ -5,7 +5,7 @@ export default {
html: `<div class="one two three"></div>`, html: `<div class="one two three"></div>`,
test(assert, component, target, window) { test({ assert, component, target, window }) {
component.myClass = 'one'; component.myClass = 'one';
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `

@ -14,7 +14,7 @@ export default {
</ol> </ol>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
input.value = 4; input.value = 4;

@ -14,7 +14,7 @@ export default {
</ol> </ol>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
input.value = 4; input.value = 4;

@ -1,5 +1,5 @@
export default { export default {
test(assert, component) { test({ assert, component }) {
let count = 0; let count = 0;
component.$on('state', ({ changed }) => { component.$on('state', ({ changed }) => {

@ -4,7 +4,7 @@ export default {
<label>lastname <input></label> <label>lastname <input></label>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const input = new window.Event('input'); const input = new window.Event('input');
const inputs = target.querySelectorAll('input'); const inputs = target.querySelectorAll('input');

@ -13,7 +13,7 @@ export default {
<p>y: foo</p> <p>y: foo</p>
`, `,
test ( assert, component, target ) { test({ assert, component, target }) {
component.x = false; component.x = false;
assert.htmlEqual( target.innerHTML, ` assert.htmlEqual( target.innerHTML, `

@ -6,7 +6,7 @@ export default {
<p>y: bar</p> <p>y: bar</p>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
component.x = false; component.x = false;
assert.htmlEqual(target.innerHTML, ` assert.htmlEqual(target.innerHTML, `

@ -30,7 +30,7 @@ export default {
<pre>ONE SOURCE\nTWO SOURCE</pre> <pre>ONE SOURCE\nTWO SOURCE</pre>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const event = new window.MouseEvent('input'); const event = new window.MouseEvent('input');
const textarea = target.querySelector('textarea'); const textarea = target.querySelector('textarea');

@ -9,7 +9,7 @@ export default {
<p>foo</p> <p>foo</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const event = new window.MouseEvent('input'); const event = new window.MouseEvent('input');
const input = target.querySelector('input'); const input = target.querySelector('input');

@ -11,7 +11,7 @@ export default {
<p>foo, bar, baz</p> <p>foo, bar, baz</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const event = new window.MouseEvent('input'); const event = new window.MouseEvent('input');
const inputs = target.querySelectorAll('input'); const inputs = target.querySelectorAll('input');

@ -7,7 +7,7 @@ export default {
<span>foo</span><span>bar</span><span>baz</span> <span>foo</span><span>bar</span><span>baz</span>
`, `,
test(assert, component, target) { test({ assert, component, target }) {
component.a = [ component.a = [
{ id: 'yep' }, { id: 'yep' },
{ id: 'nope' } { id: 'nope' }

@ -11,7 +11,7 @@ export default {
<p>foo, bar, baz</p> <p>foo, bar, baz</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const event = new window.MouseEvent('input'); const event = new window.MouseEvent('input');
const inputs = target.querySelectorAll('input'); const inputs = target.querySelectorAll('input');

@ -25,7 +25,7 @@ export default {
<p><span class=''>1</span></p> <p><span class=''>1</span></p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const click = new window.MouseEvent('click'); const click = new window.MouseEvent('click');
const spans = target.querySelectorAll('span'); const spans = target.querySelectorAll('span');

@ -15,7 +15,7 @@ export default {
<p>baz x: initial</p> <p>baz x: initial</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const click = new window.MouseEvent('click'); const click = new window.MouseEvent('click');
const buttons = [...target.querySelectorAll('button')]; const buttons = [...target.querySelectorAll('button')];

@ -4,7 +4,7 @@ export default {
<p>count: 10</p> <p>count: 10</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const click = new window.MouseEvent('click'); const click = new window.MouseEvent('click');
const button = target.querySelector('button'); const button = target.querySelector('button');

@ -7,7 +7,7 @@ export default {
<button>Hide</button> <button>Hide</button>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const click = new window.MouseEvent('click'); const click = new window.MouseEvent('click');
await target.querySelector('button').dispatchEvent(click); await target.querySelector('button').dispatchEvent(click);

@ -6,7 +6,7 @@ export default {
<p>count: 0</p> <p>count: 0</p>
`, `,
async test(assert, component, target, window) { async test({ assert, component, target, window }) {
const click = new window.MouseEvent('click'); const click = new window.MouseEvent('click');
const button = target.querySelector('button'); const button = target.querySelector('button');

@ -1,5 +1,5 @@
export default { export default {
test ( assert, component, target ) { test({ assert, component, target }) {
component.q = 42; component.q = 42;
component.foo = true; component.foo = true;

@ -5,7 +5,7 @@ export default {
html: `<div><p>foo: 42</p></div>`, html: `<div><p>foo: 42</p></div>`,
test ( assert, component, target ) { test({ assert, component, target }) {
component.foo = 99; component.foo = 99;
assert.equal( target.innerHTML, `<div><p>foo: 99</p></div>` ); assert.equal( target.innerHTML, `<div><p>foo: 99</p></div>` );

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save