DEV: ensures we are on correct page (#723)

Playwright will not accept this kind of specs as it's not reliable. You would potentially get this error:

```
     Playwright::Error:
       Element is not attached to the DOM
       Call log:
         - attempting click action
         -     - waiting for element to be visible, enabled and stable
```

What happens is that the ".nav-item_latest" would be present before navigation, and playwright would find it just before the page has loaded, the click though might happen right after page transition and the initial element wouldn't be attached to the dom anymore.
This commit is contained in:
Joffrey JAFFEUX 2025-04-25 17:21:19 +02:00 committed by GitHub
parent 5f87c53fe9
commit f874383526
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -20,10 +20,12 @@ describe "Category calendar", type: :system do
find(".nav-item_hot").click
expect(page).to have_current_path("#{category.relative_url}/l/hot")
expect(category_page).to have_selector("#category-events-calendar.fc")
find(".nav-item_latest").click
expect(page).to have_current_path("#{category.relative_url}/l/latest")
expect(category_page).to have_selector("#category-events-calendar.fc")
end
end