local I=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local A=require(I.Packages.Dex)return function()describe("\067\111\109\098\105\110\101",function()it("\067\111\109\098\105\110\101\115 \109\117\108\116\105\112\108\101 \112\114\101\109\097\100\101 \086\105\114\116\117\097\108\073\110\115\116\097\110\099\101\115",function()local I=Instance.new("\084\101\120\116\076\097\098\101\108")local f=A.Premade("\084\101\120\116\076\097\098\101\108",{Text="\070\111\111"})local T=A.Premade("\071\117\105\079\098\106\101\099\116",{},{Child=A.New("\070\114\097\109\101")})local W=A.Premade("\071\117\105\079\098\106\101\099\116",{LayoutOrder=123})f:Combine(T,W);(A.Root(I)):Render(f);(expect(table.isfrozen(f._directives))).to.equal(true);(expect(table.isfrozen(T._directives))).to.equal(true);(expect(table.isfrozen(W._directives))).to.equal(true);(expect(I.Text)).to.equal("\070\111\111");(expect(I.LayoutOrder)).to.equal(123);(expect(#I:GetChildren())).to.equal(1);(expect((I:GetChildren())[1].Name)).to.equal("\067\104\105\108\100")end)end)end
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Dex = require(ReplicatedStorage.Packages.Dex)

return function()
    describe("Combine", function()
        it("Combines multiple premade VirtualInstances", function()
            local host = Instance.new("TextLabel")
            local vInst1 = Dex.Premade("TextLabel", {
                Text = "Foo",
            })
            local vInst2 = Dex.Premade("GuiObject", {}, {
                Child = Dex.New("Frame")
            })
            local vInst3 = Dex.Premade("GuiObject", {
                LayoutOrder = 123,
            })
            vInst1:Combine(
                vInst2,
                vInst3
            )

            Dex.Root(host):Render(vInst1)

            expect(table.isfrozen(vInst1._directives)).to.equal(true)
            expect(table.isfrozen(vInst2._directives)).to.equal(true)
            expect(table.isfrozen(vInst3._directives)).to.equal(true)

            expect(host.Text).to.equal("Foo")
            expect(host.LayoutOrder).to.equal(123)
            expect(#host:GetChildren()).to.equal(1)
            expect(host:GetChildren()[1].Name).to.equal("Child")
        end)
    end)
end
