Skip to content

Commit

Permalink
Fixing page number in references (#2397)
Browse files Browse the repository at this point in the history
* Fix page number in references

RISDEV-5434

* Fix page number in reference search

RISDEV-5434
  • Loading branch information
Nadav-B authored Nov 25, 2024
1 parent 847267c commit 4875172
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ watch(
{ deep: true },
)
/** watches the changes of query related documentations params
* resets the page if change took place.
*/
watch(searchResultsCurrentPage, () => {
pageNumber.value = 0
})
onMounted(async () => {
featureToggle.value = (
await FeatureToggleService.isEnabled("neuris.new-from-search")
Expand Down
22 changes: 22 additions & 0 deletions frontend/test/e2e/caselaw/legal-periodical-evaluation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,28 @@ test.describe(
},
)

test(
"Search for references",
{ tag: "@RISDEV-5434" },
async ({ page, edition }) => {
await test.step("Page number resets when query parameters are changed", async () => {
const fileNumber = "1"

await navigateToPeriodicalReferences(page, edition.id)

await page.getByText("Suchen").click()
await page.getByLabel("nächste Ergebnisse").click()
await expect(page.getByText("Seite 2")).toBeVisible()

await fillInput(page, "Aktenzeichen", fileNumber)
await page.getByText("Suchen").click()

await expect(page.getByText("Seite 2")).toBeHidden()
await expect(page.getByText("Seite 1")).toBeVisible()
})
},
)

// Flaky, needs some clarification
// eslint-disable-next-line playwright/no-skipped-test
test.skip(
Expand Down

0 comments on commit 4875172

Please sign in to comment.