chore: cleaning up test element IDs
This commit is contained in:
parent
31bcd81101
commit
03e0318bf4
11 changed files with 48 additions and 48 deletions
|
@ -11,15 +11,15 @@ const someProps = {
|
|||
<!-- Head Stuff -->
|
||||
</head>
|
||||
<body>
|
||||
<my-counter id="counter-idle" {...someProps} client:idle>
|
||||
<my-counter id="client-idle" {...someProps} client:idle>
|
||||
<h1>Hello, client:idle!</h1>
|
||||
</my-counter>
|
||||
|
||||
<my-counter id="counter-load" {...someProps} client:load>
|
||||
<my-counter id="client-load" {...someProps} client:load>
|
||||
<h1>Hello, client:load!</h1>
|
||||
</my-counter>
|
||||
|
||||
<my-counter id="counter-visible" {...someProps} client:visible>
|
||||
<my-counter id="client-visible" {...someProps} client:visible>
|
||||
<h1>Hello, client:visible!</h1>
|
||||
</my-counter>
|
||||
</body>
|
||||
|
|
|
@ -11,7 +11,7 @@ const someProps = {
|
|||
<!-- Head Stuff -->
|
||||
</head>
|
||||
<body>
|
||||
<my-counter id="counter-media" {...someProps} client:media="(max-width: 50em)">
|
||||
<my-counter id="client-media" {...someProps} client:media="(max-width: 50em)">
|
||||
<h1>Hello, client:media!</h1>
|
||||
</my-counter>
|
||||
</body>
|
||||
|
|
|
@ -16,19 +16,19 @@ const someProps = {
|
|||
<h1>Hello, server!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-idle" {...someProps} client:idle>
|
||||
<Counter id="client-idle" {...someProps} client:idle>
|
||||
<h1>Hello, client:idle!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-load" {...someProps} client:load>
|
||||
<Counter id="client-load" {...someProps} client:load>
|
||||
<h1>Hello, client:load!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-visible" {...someProps} client:visible>
|
||||
<Counter id="client-visible" {...someProps} client:visible>
|
||||
<h1>Hello, client:visible!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-media" {...someProps} client:media="(max-width: 50em)">
|
||||
<Counter id="client-media" {...someProps} client:media="(max-width: 50em)">
|
||||
<h1>Hello, client:media!</h1>
|
||||
</Counter>
|
||||
|
||||
|
|
|
@ -16,19 +16,19 @@ const someProps = {
|
|||
<h1>Hello, server!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-idle" {...someProps} client:idle>
|
||||
<Counter id="client-idle" {...someProps} client:idle>
|
||||
<h1>Hello, client:idle!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-load" {...someProps} client:load>
|
||||
<Counter id="client-load" {...someProps} client:load>
|
||||
<h1>Hello, client:load!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-visible" {...someProps} client:visible>
|
||||
<Counter id="client-visible" {...someProps} client:visible>
|
||||
<h1>Hello, client:visible!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-media" {...someProps} client:media="(max-width: 50em)">
|
||||
<Counter id="client-media" {...someProps} client:media="(max-width: 50em)">
|
||||
<h1>Hello, client:media!</h1>
|
||||
</Counter>
|
||||
|
||||
|
|
|
@ -15,19 +15,19 @@ const someProps = {
|
|||
<h1>Hello, server!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-idle" {...someProps} client:idle>
|
||||
<Counter id="client-idle" {...someProps} client:idle>
|
||||
<h1>Hello, client:idle!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-load" {...someProps} client:load>
|
||||
<Counter id="client-load" {...someProps} client:load>
|
||||
<h1>Hello, client:load!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-visible" {...someProps} client:visible>
|
||||
<Counter id="client-visible" {...someProps} client:visible>
|
||||
<h1>Hello, client:visible!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-media" {...someProps} client:media="(max-width: 50em)">
|
||||
<Counter id="client-media" {...someProps} client:media="(max-width: 50em)">
|
||||
<h1>Hello, client:media!</h1>
|
||||
</Counter>
|
||||
</body>
|
||||
|
|
|
@ -15,19 +15,19 @@ const someProps = {
|
|||
<h1>Hello, server!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-idle" client:idle>
|
||||
<Counter id="client-idle" client:idle>
|
||||
<h1>Hello, client:idle!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-load" client:load>
|
||||
<Counter id="client-load" client:load>
|
||||
<h1>Hello, client:load!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-visible" client:visible>
|
||||
<Counter id="client-visible" client:visible>
|
||||
<h1>Hello, client:visible!</h1>
|
||||
</Counter>
|
||||
|
||||
<Counter id="counter-media" client:media="(max-width: 50rem)">
|
||||
<Counter id="client-media" client:media="(max-width: 50rem)">
|
||||
<h1>Hello, client:media!</h1>
|
||||
</Counter>
|
||||
</body>
|
||||
|
|
|
@ -26,7 +26,7 @@ test.only('Lit', async ({ page, astro }) => {
|
|||
await test.step('client:idle', async () => {
|
||||
await page.goto(astro.resolveUrl('/'));
|
||||
|
||||
const counter = page.locator('#counter-idle');
|
||||
const counter = page.locator('#client-idle');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('p');
|
||||
|
@ -41,7 +41,7 @@ test.only('Lit', async ({ page, astro }) => {
|
|||
await test.step('client:load', async () => {
|
||||
await page.goto(astro.resolveUrl('/'));
|
||||
|
||||
const counter = page.locator('#counter-load');
|
||||
const counter = page.locator('#client-load');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('p');
|
||||
|
@ -56,7 +56,7 @@ test.only('Lit', async ({ page, astro }) => {
|
|||
await test.step('client:visible', async () => {
|
||||
await page.goto(astro.resolveUrl('/'));
|
||||
|
||||
const counter = page.locator('#counter-visible');
|
||||
const counter = page.locator('#client-visible');
|
||||
await counter.scrollIntoViewIfNeeded();
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
|
@ -72,7 +72,7 @@ test.only('Lit', async ({ page, astro }) => {
|
|||
await test.step('client:media', async () => {
|
||||
await page.goto(astro.resolveUrl('/media'));
|
||||
|
||||
const counter = page.locator('#counter-media');
|
||||
const counter = page.locator('#client-media');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('p');
|
||||
|
@ -102,7 +102,7 @@ test.only('Lit', async ({ page, astro }) => {
|
|||
|
||||
await afterHMR;
|
||||
|
||||
const label = page.locator('#counter-idle h1');
|
||||
const label = page.locator('#client-idle h1');
|
||||
await expect(label).toHaveText('Hello, updated client:idle!')
|
||||
});
|
||||
});
|
||||
|
|
|
@ -39,7 +39,7 @@ test.only('Preact', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:idle', async () => {
|
||||
const counter = page.locator('#counter-idle');
|
||||
const counter = page.locator('#client-idle');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -52,7 +52,7 @@ test.only('Preact', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:load', async () => {
|
||||
const counter = page.locator('#counter-load');
|
||||
const counter = page.locator('#client-load');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -65,7 +65,7 @@ test.only('Preact', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:visible', async () => {
|
||||
const counter = page.locator('#counter-visible');
|
||||
const counter = page.locator('#client-visible');
|
||||
await counter.scrollIntoViewIfNeeded();
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
|
@ -79,7 +79,7 @@ test.only('Preact', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:media', async () => {
|
||||
const counter = page.locator('#counter-media');
|
||||
const counter = page.locator('#client-media');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -109,12 +109,12 @@ test.only('Preact', async ({ page, astro }) => {
|
|||
// test 1: updating the page component
|
||||
await astro.writeFile(
|
||||
'src/pages/index.astro',
|
||||
(original) => original.replace('id="counter-idle" {...someProps}', 'id="counter-idle" count={5}')
|
||||
(original) => original.replace('id="client-idle" {...someProps}', 'id="client-idle" count={5}')
|
||||
);
|
||||
|
||||
await afterHMR;
|
||||
|
||||
const count = page.locator('#counter-idle pre');
|
||||
const count = page.locator('#client-idle pre');
|
||||
await expect(count).toHaveText('5');
|
||||
|
||||
// test 2: updating the preact component
|
||||
|
|
|
@ -39,7 +39,7 @@ test.only('React', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:idle', async () => {
|
||||
const counter = page.locator('#counter-idle');
|
||||
const counter = page.locator('#client-idle');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -52,7 +52,7 @@ test.only('React', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:load', async () => {
|
||||
const counter = page.locator('#counter-load');
|
||||
const counter = page.locator('#client-load');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -65,7 +65,7 @@ test.only('React', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:visible', async () => {
|
||||
const counter = page.locator('#counter-visible');
|
||||
const counter = page.locator('#client-visible');
|
||||
await counter.scrollIntoViewIfNeeded();
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
|
@ -79,7 +79,7 @@ test.only('React', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:media', async () => {
|
||||
const counter = page.locator('#counter-media');
|
||||
const counter = page.locator('#client-media');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -109,12 +109,12 @@ test.only('React', async ({ page, astro }) => {
|
|||
// test 1: updating the page component
|
||||
await astro.writeFile(
|
||||
'src/pages/index.astro',
|
||||
(original) => original.replace('id="counter-idle" {...someProps}', 'id="counter-idle" count={5}')
|
||||
(original) => original.replace('id="client-idle" {...someProps}', 'id="client-idle" count={5}')
|
||||
);
|
||||
|
||||
await afterHMR;
|
||||
|
||||
const count = page.locator('#counter-idle pre');
|
||||
const count = page.locator('#client-idle pre');
|
||||
await expect(count).toHaveText('5');
|
||||
|
||||
// test 2: updating the react component
|
||||
|
|
|
@ -39,7 +39,7 @@ test.only('Solid', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:idle', async () => {
|
||||
const counter = page.locator('#counter-idle');
|
||||
const counter = page.locator('#client-idle');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -52,7 +52,7 @@ test.only('Solid', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:load', async () => {
|
||||
const counter = page.locator('#counter-load');
|
||||
const counter = page.locator('#client-load');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -65,7 +65,7 @@ test.only('Solid', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:visible', async () => {
|
||||
const counter = page.locator('#counter-visible');
|
||||
const counter = page.locator('#client-visible');
|
||||
await counter.scrollIntoViewIfNeeded();
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
|
@ -79,7 +79,7 @@ test.only('Solid', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:media', async () => {
|
||||
const counter = page.locator('#counter-media');
|
||||
const counter = page.locator('#client-media');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -102,12 +102,12 @@ test.only('Solid', async ({ page, astro }) => {
|
|||
// test 1: updating the page component
|
||||
await astro.writeFile(
|
||||
'src/pages/index.astro',
|
||||
(original) => original.replace('id="counter-idle" {...someProps}', 'id="counter-idle" count={5}')
|
||||
(original) => original.replace('id="client-idle" {...someProps}', 'id="client-idle" count={5}')
|
||||
);
|
||||
|
||||
await afterHMR;
|
||||
|
||||
const count = page.locator('#counter-idle pre');
|
||||
const count = page.locator('#client-idle pre');
|
||||
await expect(count).toHaveText('5');
|
||||
|
||||
// test 2: updating imported CSS
|
||||
|
|
|
@ -39,7 +39,7 @@ test.only('Svelte', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:idle', async () => {
|
||||
const counter = page.locator('#counter-idle');
|
||||
const counter = page.locator('#client-idle');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -52,7 +52,7 @@ test.only('Svelte', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:load', async () => {
|
||||
const counter = page.locator('#counter-load');
|
||||
const counter = page.locator('#client-load');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -65,7 +65,7 @@ test.only('Svelte', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:visible', async () => {
|
||||
const counter = page.locator('#counter-visible');
|
||||
const counter = page.locator('#client-visible');
|
||||
await counter.scrollIntoViewIfNeeded();
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
|
@ -79,7 +79,7 @@ test.only('Svelte', async ({ page, astro }) => {
|
|||
});
|
||||
|
||||
await test.step('client:media', async () => {
|
||||
const counter = page.locator('#counter-media');
|
||||
const counter = page.locator('#client-media');
|
||||
await expect(counter).toBeVisible();
|
||||
|
||||
const count = counter.locator('pre');
|
||||
|
@ -107,7 +107,7 @@ test.only('Svelte', async ({ page, astro }) => {
|
|||
|
||||
await afterHMR;
|
||||
|
||||
const label = page.locator('#counter-idle-message');
|
||||
const label = page.locator('#client-idle-message');
|
||||
await expect(label).toHaveText('Hello, updated client:idle!');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue