You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime-browser/samples/transition-css-out-in/_config.js

15 lines
789 B

export default {
test: async ({ assert, component, window, waitUntil }) => {
component.visible = true;
await waitUntil(() => window.document.head.querySelector('style').sheet.rules.length === 2);
assert.equal(window.document.head.querySelector('style').sheet.rules.length, 2);
await waitUntil(() => window.document.head.querySelector('style') === null);
assert.equal(window.document.head.querySelector('style'), null);
component.visible = false;
await waitUntil(() => window.document.head.querySelector('style').sheet.rules.length === 2);
assert.equal(window.document.head.querySelector('style').sheet.rules.length, 2);
await waitUntil(() => window.document.head.querySelector('style') === null);
assert.equal(window.document.head.querySelector('style'), null);
}
};