Skip to content
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

chore(wdio): migrate slot-no-default to wdio #5573

Merged
merged 1 commit into from
Mar 22, 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
13 changes: 0 additions & 13 deletions test/karma/test-app/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export namespace Components {
}
interface SlotNgIf {
}
interface SlotNoDefault {
}
interface SlotReplaceWrapper {
"href"?: string;
}
Expand Down Expand Up @@ -184,12 +182,6 @@ declare global {
prototype: HTMLSlotNgIfElement;
new (): HTMLSlotNgIfElement;
};
interface HTMLSlotNoDefaultElement extends Components.SlotNoDefault, HTMLStencilElement {
}
var HTMLSlotNoDefaultElement: {
prototype: HTMLSlotNoDefaultElement;
new (): HTMLSlotNoDefaultElement;
};
interface HTMLSlotReplaceWrapperElement extends Components.SlotReplaceWrapper, HTMLStencilElement {
}
var HTMLSlotReplaceWrapperElement: {
Expand Down Expand Up @@ -241,7 +233,6 @@ declare global {
"slot-nested-default-order-child": HTMLSlotNestedDefaultOrderChildElement;
"slot-nested-default-order-parent": HTMLSlotNestedDefaultOrderParentElement;
"slot-ng-if": HTMLSlotNgIfElement;
"slot-no-default": HTMLSlotNoDefaultElement;
"slot-replace-wrapper": HTMLSlotReplaceWrapperElement;
"slot-replace-wrapper-root": HTMLSlotReplaceWrapperRootElement;
"stencil-sibling": HTMLStencilSiblingElement;
Expand Down Expand Up @@ -293,8 +284,6 @@ declare namespace LocalJSX {
}
interface SlotNgIf {
}
interface SlotNoDefault {
}
interface SlotReplaceWrapper {
"href"?: string;
}
Expand Down Expand Up @@ -327,7 +316,6 @@ declare namespace LocalJSX {
"slot-nested-default-order-child": SlotNestedDefaultOrderChild;
"slot-nested-default-order-parent": SlotNestedDefaultOrderParent;
"slot-ng-if": SlotNgIf;
"slot-no-default": SlotNoDefault;
"slot-replace-wrapper": SlotReplaceWrapper;
"slot-replace-wrapper-root": SlotReplaceWrapperRoot;
"stencil-sibling": StencilSibling;
Expand Down Expand Up @@ -359,7 +347,6 @@ declare module "@stencil/core" {
"slot-nested-default-order-child": LocalJSX.SlotNestedDefaultOrderChild & JSXBase.HTMLAttributes<HTMLSlotNestedDefaultOrderChildElement>;
"slot-nested-default-order-parent": LocalJSX.SlotNestedDefaultOrderParent & JSXBase.HTMLAttributes<HTMLSlotNestedDefaultOrderParentElement>;
"slot-ng-if": LocalJSX.SlotNgIf & JSXBase.HTMLAttributes<HTMLSlotNgIfElement>;
"slot-no-default": LocalJSX.SlotNoDefault & JSXBase.HTMLAttributes<HTMLSlotNoDefaultElement>;
"slot-replace-wrapper": LocalJSX.SlotReplaceWrapper & JSXBase.HTMLAttributes<HTMLSlotReplaceWrapperElement>;
"slot-replace-wrapper-root": LocalJSX.SlotReplaceWrapperRoot & JSXBase.HTMLAttributes<HTMLSlotReplaceWrapperRootElement>;
"stencil-sibling": LocalJSX.StencilSibling & JSXBase.HTMLAttributes<HTMLStencilSiblingElement>;
Expand Down
12 changes: 0 additions & 12 deletions test/karma/test-app/slot-no-default/index.html

This file was deleted.

30 changes: 0 additions & 30 deletions test/karma/test-app/slot-no-default/karma.spec.ts

This file was deleted.

28 changes: 28 additions & 0 deletions test/wdio/slot-no-default/cmp.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { h } from '@stencil/core';
import { render } from '@wdio/browser-runner/stencil';

describe('slot-no-default', () => {
beforeEach(async () => {
render({
template: () => (
<slot-no-default>
<a slot="a-slot-name">A-Show</a>
<header slot="header-slot-name">Header-No-Show</header>
<main>Default-Slot-No-Show</main>
<nav slot="nav-slot-name">Nav-Show</nav>
<footer slot="footer-slot-name">Footer-Show</footer>
</slot-no-default>
),
});

await $('slot-no-default').waitForExist();
});

it('only renders slots that have a location', async () => {
await expect($('slot-no-default a')).not.toHaveAttribute('hidden');
await expect($('slot-no-default header')).toHaveAttribute('hidden', 'true');
await expect($('slot-no-default main')).toHaveAttribute('hidden', 'true');
await expect($('slot-no-default nav')).not.toHaveAttribute('hidden');
await expect($('slot-no-default footer')).not.toHaveAttribute('hidden');
});
});
Loading