Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions tests/e2e/marketplace-checkout-journey.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,18 @@ test.describe('Marketplace dual-persona checkout journey', () => {
await publishAnswer.click()
await expect(page.getByText(testAnswer)).toBeVisible({ timeout: 15000 })

const questionsAfterAnswer = await fetchListingQuestions(page.request, listingId)
expect(questionsAfterAnswer.find((q) => q.question === testQuestion)?.status).toBe('answered')
// The UI confirms the answer above, but the question-status write can lag the
// read by a beat — poll the API until it reflects 'answered' instead of a
// single racy fetch (which flaked with status still 'open').
await expect
.poll(
async () => {
const qs = await fetchListingQuestions(page.request, listingId)
return qs.find((q) => q.question === testQuestion)?.status
},
{ timeout: 15000 },
)
.toBe('answered')

// 2c. Seller cannot buy own listing (must run while listing is still active)
await loginWithCredentials(
Expand Down
5 changes: 4 additions & 1 deletion tests/e2e/tasks-journey.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ test.describe('Admin tasks staff journey', () => {
await expect(page.getByRole('heading', { name: 'Erledigungen (1)' })).toBeVisible({
timeout: 15000,
})
await expect(page.getByText('E2E erledigt')).toBeVisible()
// .first(): like the empty state above, the completion note renders in two
// panes (list + detail), so a bare getByText matches 2 elements once both
// panes have hydrated — which flaked under strict mode.
await expect(page.getByText('E2E erledigt').first()).toBeVisible()

if (hasDualPersonaCredentials()) {
await loginWithCredentials(page, '/dashboard', USER_TEST_EMAIL, USER_TEST_PASSWORD)
Expand Down
Loading