---
title: "Switch document versions without stale content"
description: "Verify that a document viewer changes visible content and version metadata together when selecting two prepared revisions of the same file."
canonical_url: "https://vostride.com/agent-library/files-media/document-version-switch.md"
md_url: "https://vostride.com/agent-library/files-media/document-version-switch.md"
content_kind: "recipe"
topic: "files-media"
---

# Switch document versions without stale content

Verify that a document viewer changes visible content and version metadata together when selecting two prepared revisions of the same file.

## Risk

Version controls can update a revision badge before the document renderer changes pages. Use short documents with unmistakably different visible revision markers and verify a known page in each version.

## Fixtures

- A test document already has revision one containing DRAFT ORANGE on page one and revision two containing APPROVED TEAL.
- The fixture manifest records the two revision identifiers and expected page counts, two pages for the draft and three for the approved version.
- The viewer can display these prepared documents in the application; upload mechanics and binary extraction are outside this UI recipe.

## Steps

1. Open the document detail and verify the latest revision is revision two with APPROVED TEAL on its first page.
2. Select revision one and verify DRAFT ORANGE appears while the approved marker is absent from the visible page.
3. Verify the version label and displayed page count both match the two-page draft fixture.
4. Return to revision two and verify the approved marker and three-page count return together.
5. Navigate to the last approved page and verify its prepared END OF APPROVAL marker is visible before closing the viewer.

## Expected results

- Each selected revision renders its own distinctive source content, not only its revision label.
- The page count matches the independent manifest for the selected revision.
- The last-page marker confirms the approved document can be navigated beyond a cached first-page preview.

## False-pass traps

- A metadata-only version change can pass if the page image is never checked.
- A downloaded file claim needs separate binary evidence; the viewer screenshot proves only the rendered document journey.

## Cleanup

- Remove the test document and its revisions through the approved fixture cleanup.

## 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)

- [Files and media QA recipes](/agent-library/files-media.md)
- [Software factory QA library](/agent-library.md)
