Skip to content

test(model): add live tests for version history and restore - #167

Merged
aicayzer merged 1 commit into
mainfrom
test/version-history-live
Oct 26, 2026
Merged

aicayzer merged 1 commit into
mainfrom
test/version-history-live

Conversation

@aicayzer

Copy link
Copy Markdown
Contributor

Summary

Adds two live tests for version history and restore, which until now were checked only against a fake history. They run the real MarfaServerVersions against a Marfa test instance, so a change in what the server sends, or in how restore writes back, now shows up in the Live plan.

Changes

  • New MAPPTests/MarfaVersionHistoryLiveTests.swift, a suite under LiveMarfaTests (tagged live, so the Unit plan skips it), following the other live suites' withLibrary pattern. Items are titled MAPPTEST history ... and purged when the test ends.
  • One test writes a note three times, loads its history through ItemHistoryModel over MarfaServerVersions, checks the list (two snapshots, oldest first, with the first two texts), restores the oldest version, checks the item's text in the library and on the server, checks the replaced text is now a version of its own, and checks Undo returns the text.
  • One test moves a note to the bin and checks that restoring a version is refused with the "Can't Restore Version" notice and the text on the server is unchanged.

Testing

Ran only this suite against the demo test instance with the Live plan (-only-testing:MAPPTests/LiveMarfaTests/MarfaVersionHistoryLiveTests): both tests passed, in about 18 seconds in total. A check of the instance's bin afterwards found none of the test's items left. The Unit plan was not run. Nothing was run in the UI.

Notes for reviewers

Tests only, so no release tag is needed. A review of the test file is enough. The history of an item already in the bin is not asserted, because what the server answers there was not part of the brief.

Checklist

  • The title is a scoped Conventional Commit.
  • New behavior has a test that was seen failing first, or no test was needed and the reason is above. (No behavior changed; the tests are new and passed on first run against the existing code.)
  • Docs, comments and the contract still say what is true after this change.

@aicayzer
aicayzer marked this pull request as ready for review October 26, 2026 13:21
@aicayzer
aicayzer merged commit d822f05 into main Oct 26, 2026
4 checks passed
@aicayzer
aicayzer deleted the test/version-history-live branch October 26, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant