---
title: "Reset pagination when filters narrow results"
description: "Verify that applying a restrictive filter from a later results page returns to a valid page and reveals the matching record immediately."
canonical_url: "https://vostride.com/agent-library/search-filtering/filter-resets-pagination.md"
md_url: "https://vostride.com/agent-library/search-filtering/filter-resets-pagination.md"
content_kind: "recipe"
topic: "search-filtering"
---

# Reset pagination when filters narrow results

Verify that applying a restrictive filter from a later results page returns to a valid page and reveals the matching record immediately.

## Risk

A result set may become smaller than the current page offset. Retaining that offset can show an empty page even when matching records exist, making a valid filter appear broken.

## Fixtures

- A test-owned directory has twenty-four records, a page size of ten, and stable alphabetical ordering.
- Only the record Atlas specialist has department Research; its identifier is known from the seed manifest.
- Pagination begins without persisted query state, and the fixture count is recorded before the journey.

## Steps

1. Open the directory and verify page one contains ten rows and the total count is twenty-four.
2. Navigate to page three and verify four rows are visible with page three selected.
3. Apply department Research and verify Atlas specialist appears as the sole matching row.
4. Verify pagination now identifies the first valid page and does not offer an enabled next page.
5. Clear the filter and verify the directory starts at a valid first page with the total restored to twenty-four.

## Expected results

- The narrowed result contains the specialist key even though the original offset was beyond its result set.
- The pagination display and enabled controls agree with a one-record result.
- Clearing the filter restores the full count without duplicating or losing any seeded directory entries.

## False-pass traps

- A zero-row page with a Research chip is a failure, not a legitimate no-results state.
- Automatically clicking Previous until data appears would conceal the reset regression being tested.

## Cleanup

- Delete the test directory records and clear persisted pagination or filter preferences.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Search and filtering QA recipes](/agent-library/search-filtering.md)
- [Software factory QA library](/agent-library.md)
