0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

Add delay

This commit is contained in:
Matt Kane 2024-12-23 15:52:15 +00:00
parent 063dd0e814
commit d9876187ab
2 changed files with 2 additions and 1 deletions

View file

@ -26,6 +26,7 @@ test.describe('Astro Actions - Blog', () => {
const likeButton = page.getByLabel('Like');
await waitForHydrate(page, likeButton);
await new Promise(resolve => setTimeout(resolve, 500))
await expect(likeButton, 'like button starts with 10 likes').toContainText('10');
await likeButton.click();
await expect(likeButton, 'like button should increment likes').toContainText('11');

View file

@ -24,9 +24,9 @@ test.afterAll(async () => {
test.describe('Astro Actions - React 19', () => {
test('Like action - client pending state', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/blog/first-post/'));
const likeButton = page.getByLabel('likes-client');
await waitForHydrate(page, likeButton);
await new Promise(resolve => setTimeout(resolve, 500))
await expect(likeButton).toBeVisible();
await likeButton.click();