Skip to content

chore: unskip more tests #12621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { test } from '../../assert';
const tick = () => Promise.resolve();

export default test({
skip: true, // TODO: needs inline CSS, decide how to add
async test({ assert, target }) {
target.innerHTML = '<custom-element></custom-element>';
await tick();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,16 @@ import { flushSync } from 'svelte';
import { test } from '../../test';

export default test({
skip: true, // TODO: needs fixing

html: `
<button>Click Me</button>
<div>1</div>
`,
async test({ assert, target, window }) {
async test({ assert, target, logs }) {
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(() => {
// @ts-ignore
button.dispatchEvent(event);
});
button?.click();
flushSync();

console.log = log;
assert.deepEqual(messages, ['afterUpdate', 'onDestroy']);
assert.deepEqual(logs, ['afterUpdate', 'onDestroy']);
}
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// @ts-nocheck
import { test } from '../../test';

export default test({
skip: true, // TODO: needs fixing

get props() {
return {
things: [
Expand All @@ -27,7 +24,9 @@ export default test({
test({ assert, component, target, raf }) {
let divs = target.querySelectorAll('div');
divs.forEach((div) => {
// @ts-expect-error
div.getBoundingClientRect = function () {
// @ts-expect-error
const index = [...this.parentNode.children].indexOf(this);
const top = index * 30;

Expand All @@ -49,13 +48,13 @@ export default test({
];

divs = target.querySelectorAll('div');
assert.ok(~divs[0].style.animation.indexOf('__svelte'));
assert.equal(divs[1].style.animation, '');
assert.equal(divs[2].style.animation, '');
assert.equal(divs[3].style.animation, '');
assert.ok(~divs[4].style.animation.indexOf('__svelte'));
assert.ok(divs[0].getAnimations().length > 0);
assert.equal(divs[1].getAnimations().length, 0);
assert.equal(divs[2].getAnimations().length, 0);
assert.equal(divs[3].getAnimations().length, 0);
assert.ok(divs[4].getAnimations().length > 0);

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]);
}
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from '../../test';

export default test({
skip: true, // TODO: needs fixing
mode: ['client', 'hydrate'],

html: `
<span>3</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { test } from '../../test';

export default test({
skip: true, // TODO: needs fixing, error message is wrong

compileOptions: {
dev: true
},
Expand All @@ -17,7 +15,7 @@ export default test({
throw new Error('Expected an error');
} catch (err) {
// @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');
}
}
});
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { test } from '../../test';

export default test({
// This is skipped for now, because it's not clear how to make this work on client-side initial run:
// 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>',
html: '<svg xmlns="http://www.w3.org/2000/svg"><path></path></svg>',

test({ assert, target }) {
const svg = target.querySelector('svg');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
export let path = 'path';
</script>

<svelte:element this={svg}>
<svelte:element this={svg} xmlns="http://www.w3.org/2000/svg">
<svelte:element this={path}></svelte:element>
</svelte:element>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { test } from '../../test';

export default test({
skip: true,
compileOptions: {
customElement: true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { test } from '../../test';

export default test({
skip: true,
compileOptions: {
customElement: true
}
Expand Down
Loading