local K=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local H=require(K.Packages.Dex)return function()describe("\079\117\116\080\114\111\112\101\114\116\121",function()it("\067\111\110\110\101\099\116\115 \097 \108\105\115\116\101\110\101\114 \116\111 \097 \114\101\110\100\101\114\101\100 \105\110\115\116\097\110\099\101\'\115 \112\114\111\112\101\114\116\121",function()local K=Instance.new("\070\114\097\109\101")local x=H.Premade("\070\114\097\109\101")x:SetProperties({Name="\070\111\111"})local d=x:OutProperty("\078\097\109\101","\070\105\103\104\116\101\114\115");(expect(d:Current())).to.equal("\070\105\103\104\116\101\114\115")local b=H.Root(K)b:Render(x);(expect(d:Current())).to.equal("\070\111\111")K.Name="\066\097\114";(expect(d:Current())).to.equal("\066\097\114")b:Unmount()K.Name="\066\097\122";(expect(d:Current())).to.equal("\066\097\114")end)it("\067\111\110\110\101\099\116\115 \097 \108\105\115\116\101\110\101\114 \116\111 \097\110 \105\110\115\116\097\110\099\101\'\115 \105\110\105\116\105\097\108 \040\112\114\101-\109\111\117\110\116\041 \112\114\111\112\101\114\116\105\101\115",function()local K=Instance.new("\070\114\097\109\101")K.Name="\070\111\111"local x=H.Premade("\070\114\097\109\101")x:SetProperties({Name="\070\105\103\104\116\101\114\115"})local d=x:OutInitialProperty("\078\097\109\101","\066\097\114");(expect(d:Current())).to.equal("\066\097\114")local b=H.Root(K)b:Render(x);(expect(d:Current())).to.equal("\070\111\111")b:Unmount()K.Name="\066\097\122";(expect(d:Current())).to.equal("\070\111\111")end)end)end
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Dex = require(ReplicatedStorage.Packages.Dex)
return function()
    describe("OutProperty", function()
        it("Connects a listener to a rendered instance's property", function()
            local host = Instance.new("Frame")
            local virtualInstance = Dex.Premade("Frame")
            virtualInstance:SetProperties({ Name = "Foo" })
            
            local nameObs = virtualInstance:OutProperty("Name", "Fighters")
            expect(nameObs:Current()).to.equal("Fighters")

            local root = Dex.Root(host)
            root:Render(virtualInstance)
            expect(nameObs:Current()).to.equal("Foo")
        
            host.Name = "Bar"
            expect(nameObs:Current()).to.equal("Bar")

            root:Unmount()
            host.Name = "Baz"
            expect(nameObs:Current()).to.equal("Bar")
        end)
        it("Connects a listener to an instance's initial (pre-mount) properties", function()
            local host = Instance.new("Frame")
            host.Name = "Foo" 
            local virtualInstance = Dex.Premade("Frame")
            virtualInstance:SetProperties({ Name = "Fighters" })
            
            local nameObs = virtualInstance:OutInitialProperty("Name", "Bar")
            expect(nameObs:Current()).to.equal("Bar")

            local root = Dex.Root(host)
            root:Render(virtualInstance)
            expect(nameObs:Current()).to.equal("Foo")

            root:Unmount()
            host.Name = "Baz"
            expect(nameObs:Current()).to.equal("Foo")
        end)
    end)
end