Skip to content

Commit

Permalink
test: fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Moore committed May 26, 2022
1 parent 72373b1 commit ee3ee55
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 30 deletions.
10 changes: 5 additions & 5 deletions packages/astro/e2e/client-only.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test.describe('Client only', () => {
const count = await counter.locator('pre');
await expect(count, 'initial count is 0').toHaveText('0');

const children = await counter.locator('h1');
const children = await counter.locator('.children');
await expect(children, 'children exist').toHaveText('react');

const increment = await counter.locator('.increment');
Expand All @@ -46,7 +46,7 @@ test.describe('Client only', () => {
const count = await counter.locator('pre');
await expect(count, 'initial count is 0').toHaveText('0');

const children = await counter.locator('h1');
const children = await counter.locator('.children');
await expect(children, 'children exist').toHaveText('preact');

const increment = await counter.locator('.increment');
Expand All @@ -64,7 +64,7 @@ test.describe('Client only', () => {
const count = await counter.locator('pre');
await expect(count, 'initial count is 0').toHaveText('0');

const children = await counter.locator('h1');
const children = await counter.locator('.children');
await expect(children, 'children exist').toHaveText('solid');

const increment = await counter.locator('.increment');
Expand All @@ -82,7 +82,7 @@ test.describe('Client only', () => {
const count = await counter.locator('pre');
await expect(count, 'initial count is 0').toHaveText('0');

const children = await counter.locator('h1');
const children = await counter.locator('.children');
await expect(children, 'children exist').toHaveText('vue');

const increment = await counter.locator('.increment');
Expand All @@ -100,7 +100,7 @@ test.describe('Client only', () => {
const count = await counter.locator('pre');
await expect(count, 'initial count is 0').toHaveText('0');

const children = await counter.locator('h1');
const children = await counter.locator('.children');
await expect(children, 'children exist').toHaveText('svelte');

const increment = await counter.locator('.increment');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ export function PreactCounter({ children, id }) {
const subtract = () => setCount((i) => i - 1);

return (
<>
<div id={id} class="counter">
<button class="decrement" onClick={subtract}>-</button>
<pre>{count}</pre>
<button class="increment" onClick={add}>+</button>
</div>
<div class="counter-message">{children}</div>
</>
<div id={id} class="counter">
<button class="decrement" onClick={subtract}>-</button>
<pre>{count}</pre>
<button class="increment" onClick={add}>+</button>
<div class="children">{children}</div>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ export function Counter({ children, id }) {
const subtract = () => setCount((i) => i - 1);

return (
<>
<div id={id} className="counter">
<button className="decrement" onClick={subtract}>-</button>
<pre>{count}</pre>
<button className="increment" onClick={add}>+</button>
</div>
<div className="counter-message">{children}</div>
</>
<div id={id} className="counter">
<button className="decrement" onClick={subtract}>-</button>
<pre>{count}</pre>
<button className="increment" onClick={add}>+</button>
<div className="children">{children}</div>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ export default function SolidCounter({ children, id }) {
const subtract = () => setCount(count() - 1);

return (
<>
<div id={id} class="counter">
<button class="decrement" onClick={subtract}>-</button>
<pre>{count()}</pre>
<button class="increment" onClick={add}>+</button>
<div class="children">{children}</div>
</div>
<div class="counter-message">{children}</div>
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<button class="decrement" on:click={subtract}>-</button>
<pre>{ count }</pre>
<button class="increment" on:click={add}>+</button>
</div>
<div class="counter-message">
<slot />
<div class="children">
<slot />
</div>
</div>

<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<button class="decrement" @click="subtract()">-</button>
<pre>{{ count }}</pre>
<button class="increment" @click="add()">+</button>
</div>
<div class="counter-message">
<slot />
<div class="children">
<slot />
</div>
</div>
</template>

Expand Down

0 comments on commit ee3ee55

Please sign in to comment.