diff --git a/test/e2e/tests/inputs/text.spec.ts b/test/e2e/tests/inputs/text.spec.ts index d8d42d0a88a..7391562812b 100644 --- a/test/e2e/tests/inputs/text.spec.ts +++ b/test/e2e/tests/inputs/text.spec.ts @@ -85,21 +85,18 @@ test.describe('inputs: text', () => { await expect(page.getByTestId('document-panel-scroller')).toBeAttached() await titleInput.fill('Title A') - - // generally waiting for timeouts is not a good idea but for this specific instance - // since we are using `.fill` and `.click` they can cause the draft creation and publish to happen at the same exact time. - // We are waiting for 1s to make sure the draft actually gets created and click action is not too eager - await page.waitForTimeout(1000) + await expect(paneFooter).toHaveText(/draft Edited just now/i) // Wait for the document to be published. publishButton.click() - expect(await paneFooter.textContent()).toMatch(/published/i) + await expect(paneFooter).toHaveText(/published/i) // Change the title. await titleInput.fill('Title B') + await expect(paneFooter).toHaveText(/draft Edited just now/i) // Wait for the document to be published. publishButton.click() - expect(await paneFooter.textContent()).toMatch(/published/i) + await expect(paneFooter).toHaveText(/published/i) }) })