Refactor test cases and improve snapshot handling

- Simplified the formatting of function calls in `encodePatchUpdate.spec.lua` for better readability.
- Added multiple new snapshot files to enhance end-to-end testing for reference path changes, including scenarios for adding, removing, and handling nonexistent attributes.
- Updated test cases in `apply.rs`, `compute.rs`, and `api.rs` to ensure consistent handling of reference properties and improve clarity in property updates.

These changes enhance the maintainability of the test suite and improve the robustness of snapshot testing.
This commit is contained in:
Joe 2026-02-14 11:36:48 -06:00
parent bbd9c0e0fa
commit c181172460
11 changed files with 463 additions and 232 deletions

View file

@ -145,12 +145,7 @@ return function()
instanceMap:insert("MODEL_ID", model)
instanceMap:insert("PART_ID", part)
local update = encodePatchUpdate(
model,
"MODEL_ID",
{ PrimaryPart = true, Name = true },
instanceMap
)
local update = encodePatchUpdate(model, "MODEL_ID", { PrimaryPart = true, Name = true }, instanceMap)
expect(update).to.be.ok()
expect(update.changedProperties.PrimaryPart).to.be.ok()
@ -239,12 +234,7 @@ return function()
instanceMap:insert("PART_A", partA)
instanceMap:insert("PART_B", partB)
local update = encodePatchUpdate(
weld,
"WELD_ID",
{ Part0 = true, Part1 = true },
instanceMap
)
local update = encodePatchUpdate(weld, "WELD_ID", { Part0 = true, Part1 = true }, instanceMap)
expect(update).to.be.ok()
expect(update.changedProperties.Part0).to.be.ok()