Skip to content

Commit

Permalink
chore(wdio): move slot-basic tests to wdio
Browse files Browse the repository at this point in the history
  • Loading branch information
alicewriteswrongs committed Mar 20, 2024
1 parent 32e871a commit 4bb63c9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
6 changes: 0 additions & 6 deletions test/karma/test-app/slot-basic/index.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { setupDomTests, waitForChanges } from '../util';
import { h } from '@stencil/core';
import { render } from '@wdio/browser-runner/stencil';

describe('slot-basic', function () {
const { setupDom, tearDownDom } = setupDomTests(document);
let app: HTMLElement;

beforeEach(async () => {
app = await setupDom('/slot-basic/index.html');
beforeEach(() => {
render({
template: () => <slot-basic-root></slot-basic-root>,
});
});
afterEach(tearDownDom);

it('button click rerenders', async () => {
function testValues(inc: number) {
const app = document.body;
async function testValues(inc: number) {
await $('slot-basic-root').waitForStable();
let result = app.querySelector('.inc');
expect(result.textContent).toEqual('Rendered: ' + inc);

Expand Down Expand Up @@ -91,15 +92,12 @@ describe('slot-basic', function () {
expect(result.textContent).toEqual('B');
}

testValues(1);
await testValues(1);

let button = app.querySelector('button');
button.click();
await waitForChanges();
testValues(2);
await $('button').click();
await testValues(2);

button.click();
await waitForChanges();
testValues(3);
await $('button').click();
await testValues(3);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, State, h } from '@stencil/core';
import { Component, h, State } from '@stencil/core';

const textA = 'A';
const spanA = <span>A</span>;
Expand Down
File renamed without changes.

0 comments on commit 4bb63c9

Please sign in to comment.