chore: unskip more tests (#12621)

pull/12623/head
Simon H 4 months ago committed by GitHub
parent e1728e5a0b
commit 0f41689916
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,6 +0,0 @@
import { test } from '../../test';
export default test({
// TODO JSDOM doesn't support container queries
skip: true
});

@ -2,7 +2,6 @@ import { test } from '../../assert';
const tick = () => Promise.resolve(); const tick = () => Promise.resolve();
export default test({ export default test({
skip: true, // TODO: needs inline CSS, decide how to add
async test({ assert, target }) { async test({ assert, target }) {
target.innerHTML = '<custom-element></custom-element>'; target.innerHTML = '<custom-element></custom-element>';
await tick(); await tick();

@ -2,28 +2,16 @@ import { flushSync } from 'svelte';
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
skip: true, // TODO: needs fixing
html: ` html: `
<button>Click Me</button> <button>Click Me</button>
<div>1</div> <div>1</div>
`, `,
async test({ assert, target, window }) { async test({ assert, target, logs }) {
const button = target.querySelector('button'); const button = target.querySelector('button');
const event = new window.MouseEvent('click');
/**
* @type {any[]}
*/
const messages = [];
const log = console.log;
console.log = (msg) => messages.push(msg);
flushSync(() => { button?.click();
// @ts-ignore flushSync();
button.dispatchEvent(event);
});
console.log = log; assert.deepEqual(logs, ['afterUpdate', 'onDestroy']);
assert.deepEqual(messages, ['afterUpdate', 'onDestroy']);
} }
}); });

@ -1,9 +1,6 @@
// @ts-nocheck
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
skip: true, // TODO: needs fixing
get props() { get props() {
return { return {
things: [ things: [
@ -27,7 +24,9 @@ export default test({
test({ assert, component, target, raf }) { test({ assert, component, target, raf }) {
let divs = target.querySelectorAll('div'); let divs = target.querySelectorAll('div');
divs.forEach((div) => { divs.forEach((div) => {
// @ts-expect-error
div.getBoundingClientRect = function () { div.getBoundingClientRect = function () {
// @ts-expect-error
const index = [...this.parentNode.children].indexOf(this); const index = [...this.parentNode.children].indexOf(this);
const top = index * 30; const top = index * 30;
@ -49,13 +48,13 @@ export default test({
]; ];
divs = target.querySelectorAll('div'); divs = target.querySelectorAll('div');
assert.ok(~divs[0].style.animation.indexOf('__svelte')); assert.ok(divs[0].getAnimations().length > 0);
assert.equal(divs[1].style.animation, ''); assert.equal(divs[1].getAnimations().length, 0);
assert.equal(divs[2].style.animation, ''); assert.equal(divs[2].getAnimations().length, 0);
assert.equal(divs[3].style.animation, ''); assert.equal(divs[3].getAnimations().length, 0);
assert.ok(~divs[4].style.animation.indexOf('__svelte')); assert.ok(divs[4].getAnimations().length > 0);
raf.tick(100); raf.tick(100);
assert.deepEqual([divs[0].style.animation, divs[4].style.animation], ['', '']); assert.deepEqual([divs[0].getAnimations().length, divs[4].getAnimations().length], [0, 0]);
} }
}); });

@ -1,7 +1,7 @@
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
skip: true, // TODO: needs fixing mode: ['client', 'hydrate'],
html: ` html: `
<span>3</span> <span>3</span>

@ -1,8 +1,6 @@
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
skip: true, // TODO: needs fixing, error message is wrong
compileOptions: { compileOptions: {
dev: true dev: true
}, },
@ -17,7 +15,7 @@ export default test({
throw new Error('Expected an error'); throw new Error('Expected an error');
} catch (err) { } catch (err) {
// @ts-ignore // @ts-ignore
assert.equal(err.message, "<Main>: Cannot set read-only property 'foo'"); assert.equal(err.message, 'Cannot set property foo of #<Object> which has only a getter');
} }
} }
}); });

@ -1,11 +1,7 @@
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
// This is skipped for now, because it's not clear how to make this work on client-side initial run: html: '<svg xmlns="http://www.w3.org/2000/svg"><path></path></svg>',
// The anchor isn't connected to its parent at the time we can do a runtime check for the namespace, and we
// need the parent for this check. (this didn't work in Svelte 4 either)
skip: true,
html: '<svg><path></path></svg>',
test({ assert, target }) { test({ assert, target }) {
const svg = target.querySelector('svg'); const svg = target.querySelector('svg');

@ -5,6 +5,6 @@
export let path = 'path'; export let path = 'path';
</script> </script>
<svelte:element this={svg}> <svelte:element this={svg} xmlns="http://www.w3.org/2000/svg">
<svelte:element this={path}></svelte:element> <svelte:element this={path}></svelte:element>
</svelte:element> </svelte:element>

@ -1,7 +1,6 @@
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
skip: true,
compileOptions: { compileOptions: {
customElement: true customElement: true
} }

@ -1,7 +1,6 @@
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
skip: true,
compileOptions: { compileOptions: {
customElement: true customElement: true
} }

Loading…
Cancel
Save