chore: test cleanup

This commit is contained in:
Tony Sullivan 2022-05-16 13:57:22 -05:00
parent 8326cfddf7
commit 31bcd81101
10 changed files with 75 additions and 1 deletions

View file

@ -12,6 +12,10 @@ const someProps = {
<!-- Head Stuff --> <!-- Head Stuff -->
</head> </head>
<body> <body>
<Counter id="server-only" {...someProps}>
<h1>Hello, server!</h1>
</Counter>
<Counter id="counter-idle" {...someProps} client:idle> <Counter id="counter-idle" {...someProps} client:idle>
<h1>Hello, client:idle!</h1> <h1>Hello, client:idle!</h1>
</Counter> </Counter>

View file

@ -12,6 +12,10 @@ const someProps = {
<!-- Head Stuff --> <!-- Head Stuff -->
</head> </head>
<body> <body>
<Counter id="server-only" {...someProps}>
<h1>Hello, server!</h1>
</Counter>
<Counter id="counter-idle" {...someProps} client:idle> <Counter id="counter-idle" {...someProps} client:idle>
<h1>Hello, client:idle!</h1> <h1>Hello, client:idle!</h1>
</Counter> </Counter>

View file

@ -11,6 +11,10 @@ const someProps = {
<!-- Head Stuff --> <!-- Head Stuff -->
</head> </head>
<body> <body>
<Counter id="server-only" {...someProps}>
<h1>Hello, server!</h1>
</Counter>
<Counter id="counter-idle" {...someProps} client:idle> <Counter id="counter-idle" {...someProps} client:idle>
<h1>Hello, client:idle!</h1> <h1>Hello, client:idle!</h1>
</Counter> </Counter>

View file

@ -11,6 +11,10 @@ const someProps = {
<!-- Head Stuff --> <!-- Head Stuff -->
</head> </head>
<body> <body>
<Counter id="server-only">
<h1>Hello, server!</h1>
</Counter>
<Counter id="counter-idle" client:idle> <Counter id="counter-idle" client:idle>
<h1>Hello, client:idle!</h1> <h1>Hello, client:idle!</h1>
</Counter> </Counter>

View file

@ -57,6 +57,7 @@ test.only('Lit', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/')); await page.goto(astro.resolveUrl('/'));
const counter = page.locator('#counter-visible'); const counter = page.locator('#counter-visible');
await counter.scrollIntoViewIfNeeded();
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
const count = counter.locator('p'); const count = counter.locator('p');

View file

@ -25,6 +25,19 @@ test.afterEach(async ({ astro }) => {
test.only('Preact', async ({ page, astro }) => { test.only('Preact', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/')); await page.goto(astro.resolveUrl('/'));
await test.step('server only', async () => {
const counter = page.locator('#server-only');
await expect(counter).toBeVisible();
const count = counter.locator('pre');
await expect(count).toHaveText('0');
const inc = counter.locator('.increment');
await inc.click();
await expect(count).toHaveText('0');
});
await test.step('client:idle', async () => { await test.step('client:idle', async () => {
const counter = page.locator('#counter-idle'); const counter = page.locator('#counter-idle');
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
@ -53,6 +66,7 @@ test.only('Preact', async ({ page, astro }) => {
await test.step('client:visible', async () => { await test.step('client:visible', async () => {
const counter = page.locator('#counter-visible'); const counter = page.locator('#counter-visible');
await counter.scrollIntoViewIfNeeded();
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
const count = counter.locator('pre'); const count = counter.locator('pre');

View file

@ -25,6 +25,19 @@ test.afterEach(async ({ astro }) => {
test.only('React', async ({ page, astro }) => { test.only('React', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/')); await page.goto(astro.resolveUrl('/'));
await test.step('server only', async () => {
const counter = page.locator('#server-only');
await expect(counter).toBeVisible();
const count = counter.locator('pre');
await expect(count).toHaveText('0');
const inc = counter.locator('.increment');
await inc.click();
await expect(count).toHaveText('0');
});
await test.step('client:idle', async () => { await test.step('client:idle', async () => {
const counter = page.locator('#counter-idle'); const counter = page.locator('#counter-idle');
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
@ -53,6 +66,7 @@ test.only('React', async ({ page, astro }) => {
await test.step('client:visible', async () => { await test.step('client:visible', async () => {
const counter = page.locator('#counter-visible'); const counter = page.locator('#counter-visible');
await counter.scrollIntoViewIfNeeded();
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
const count = counter.locator('pre'); const count = counter.locator('pre');

View file

@ -25,6 +25,19 @@ test.afterEach(async ({ astro }) => {
test.only('Solid', async ({ page, astro }) => { test.only('Solid', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/')); await page.goto(astro.resolveUrl('/'));
await test.step('server only', async () => {
const counter = page.locator('#server-only');
await expect(counter).toBeVisible();
const count = counter.locator('pre');
await expect(count).toHaveText('0');
const inc = counter.locator('.increment');
await inc.click();
await expect(count).toHaveText('0');
});
await test.step('client:idle', async () => { await test.step('client:idle', async () => {
const counter = page.locator('#counter-idle'); const counter = page.locator('#counter-idle');
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
@ -53,6 +66,7 @@ test.only('Solid', async ({ page, astro }) => {
await test.step('client:visible', async () => { await test.step('client:visible', async () => {
const counter = page.locator('#counter-visible'); const counter = page.locator('#counter-visible');
await counter.scrollIntoViewIfNeeded();
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
const count = counter.locator('pre'); const count = counter.locator('pre');

View file

@ -25,6 +25,19 @@ test.afterEach(async ({ astro }) => {
test.only('Svelte', async ({ page, astro }) => { test.only('Svelte', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/')); await page.goto(astro.resolveUrl('/'));
await test.step('server only', async () => {
const counter = page.locator('#server-only');
await expect(counter).toBeVisible();
const count = counter.locator('pre');
await expect(count).toHaveText('0');
const inc = counter.locator('.increment');
await inc.click();
await expect(count).toHaveText('0');
});
await test.step('client:idle', async () => { await test.step('client:idle', async () => {
const counter = page.locator('#counter-idle'); const counter = page.locator('#counter-idle');
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
@ -53,6 +66,7 @@ test.only('Svelte', async ({ page, astro }) => {
await test.step('client:visible', async () => { await test.step('client:visible', async () => {
const counter = page.locator('#counter-visible'); const counter = page.locator('#counter-visible');
await counter.scrollIntoViewIfNeeded();
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
const count = counter.locator('pre'); const count = counter.locator('pre');

View file

@ -25,7 +25,7 @@ test.afterEach(async ({ astro }) => {
test.only('Vue', async ({ page, astro }) => { test.only('Vue', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/')); await page.goto(astro.resolveUrl('/'));
await test.step('client:only', async () => { await test.step('server only', async () => {
const counter = page.locator('#server-only'); const counter = page.locator('#server-only');
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
@ -90,6 +90,7 @@ test.only('Vue', async ({ page, astro }) => {
await test.step('client:visible', async () => { await test.step('client:visible', async () => {
const counter = page.locator('#client-visible'); const counter = page.locator('#client-visible');
await counter.scrollIntoViewIfNeeded();
await expect(counter).toBeVisible(); await expect(counter).toBeVisible();
await counter.scrollIntoViewIfNeeded(); await counter.scrollIntoViewIfNeeded();