Update ChangeBatcher tests to reflect encoding behavior for duplicate-named children

- Renamed test case to clarify that children with duplicate names are now encoded rather than skipped.
- Adjusted assertions to ensure all children are included in the encoded output, aligning with the updated encoding logic.
- Refactored related test cases for improved clarity and maintainability.

These changes enhance the accuracy of the ChangeBatcher tests, ensuring they correctly validate the new encoding behavior.
This commit is contained in:
Joe 2026-02-17 05:00:24 -06:00
parent bb9d241253
commit aabbfb23b2
5 changed files with 75 additions and 32 deletions

View file

@ -232,7 +232,7 @@ return function()
root:Destroy()
end)
it("should skip children with duplicate names", function()
it("should encode children with duplicate names", function()
local parent = Instance.new("Folder")
parent.Name = "Parent"
@ -254,9 +254,8 @@ return function()
local encoded = encodeInstance(parent, "PARENT_ID")
expect(encoded).to.be.ok()
-- Should only have 1 child (UniqueName), duplicates skipped
expect(#encoded.children).to.equal(1)
expect(encoded.children[1].name).to.equal("UniqueName")
-- All children are encoded (server handles duplicates via dedup suffixes)
expect(#encoded.children).to.equal(3)
parent:Destroy()
end)