Skip to content

Commit

Permalink
Simplify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Jun 17, 2024
1 parent 9c6aefa commit 17a7b24
Showing 1 changed file with 12 additions and 30 deletions.
42 changes: 12 additions & 30 deletions tests/svelte.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ import Test3 from './components/Test3.svelte';

describe('Svelte', () => {
test('should update text content', async () => {
const { container, rerender } = render(
Test1,
{
props: {
text: 'Text',
},
const { container, rerender } = render(Test1, {
props: {
text: 'Text',
},
{
container: document.createElement('div'),
}
);
});

const element = container.children[0];
const textNode = element.childNodes[0];
Expand All @@ -43,17 +37,11 @@ describe('Svelte', () => {
});

test('should update text content with multiple text nodes', async () => {
const { container, rerender } = render(
Test2,
{
props: {
text: 'Text',
},
const { container, rerender } = render(Test2, {
props: {
text: 'Text',
},
{
container: document.createElement('div'),
}
);
});

const element = container.children[0];
const textNode = element.childNodes[0];
Expand All @@ -80,17 +68,11 @@ describe('Svelte', () => {
});

test('should update named slots', async () => {
const { container, rerender } = render(
Test3,
{
props: {
title: true,
},
const { container, rerender } = render(Test3, {
props: {
title: true,
},
{
container: document.createElement('div'),
}
);
});
const element = container.children[0];
const textNode = element.childNodes[0];
const lastNode = element.childNodes[2];
Expand Down

0 comments on commit 17a7b24

Please sign in to comment.