Skip to content

Commit

Permalink
test(ct): component as slot
Browse files Browse the repository at this point in the history
  • Loading branch information
sand4rt committed Oct 13, 2022
1 parent 693ed9b commit b10ea13
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/components/ct-react-vite/src/tests.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ test('render a default child', async ({ mount }) => {
await expect(component).toContainText('Main Content')
})

test('render a component as slot', async ({ mount }) => {
const component = await mount(<DefaultChildren>
<Button title="Submit" />
</DefaultChildren>)
expect(component).toContainText('Submit')
});

test('render multiple children', async ({ mount }) => {
const component = await mount(<DefaultChildren>
<div id="one">One</div>
Expand Down
7 changes: 7 additions & 0 deletions tests/components/ct-react/src/tests.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ test('render a default child', async ({ mount }) => {
await expect(component).toContainText('Main Content')
})

test('render a component as slot', async ({ mount }) => {
const component = await mount(<DefaultChildren>
<Button title="Submit" />
</DefaultChildren>)
expect(component).toContainText('Submit')
})

test('render multiple children', async ({ mount }) => {
const component = await mount(<DefaultChildren>
<div id="one">One</div>
Expand Down
8 changes: 8 additions & 0 deletions tests/components/ct-solid/src/tests.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ test('render multiple children', async ({ mount }) => {
await expect(component.locator('#two')).toContainText('Two');
});


test('render a component as slot', async ({ mount }) => {
const component = await mount(<DefaultChildren>
<Button title="Submit" />
</DefaultChildren>)
expect(component).toContainText('Submit')
});

test('render named children', async ({ mount }) => {
const component = await mount(
<MultipleChildren>
Expand Down
7 changes: 7 additions & 0 deletions tests/components/ct-vue-cli/src/notation-jsx.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ test('render a default slot', async ({ mount }) => {
await expect(component).toContainText('Main Content')
})

test('render a component as slot', async ({ mount }) => {
const component = await mount(<DefaultSlot>
<Button title="Submit" />
</DefaultSlot>)
expect(component).toContainText('Submit')
});

test('render a component with multiple children', async ({ mount }) => {
const component = await mount(<DefaultSlot>
<div id="one">One</div>
Expand Down
7 changes: 7 additions & 0 deletions tests/components/ct-vue-vite/src/notation-jsx.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ test('render a default slot', async ({ mount }) => {
await expect(component).toContainText('Main Content')
})

test('render a component as slot', async ({ mount }) => {
const component = await mount(<DefaultSlot>
<Button title="Submit" />
</DefaultSlot>)
expect(component).toContainText('Submit')
});

test('render a component with multiple slots', async ({ mount }) => {
const component = await mount(<DefaultSlot>
<div id="one">One</div>
Expand Down
7 changes: 7 additions & 0 deletions tests/components/ct-vue2-cli/src/notation-jsx.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ test('render a default slot', async ({ mount }) => {
await expect(component).toContainText('Main Content')
})

test('render a component as slot', async ({ mount }) => {
const component = await mount(<DefaultChildren>
<Button title="Submit" />
</DefaultChildren>)
expect(component).toContainText('Submit')
});

test('render a component with multiple slots', async ({ mount }) => {
const component = await mount(<DefaultSlot>
<div id="one">One</div>
Expand Down

0 comments on commit b10ea13

Please sign in to comment.