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\065\116\116\114\105\098\117\116\101",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 \097\116\116\114\105\098\117\116\101\115",function()local K=Instance.new("\070\114\097\109\101")local x=H.Premade("\070\114\097\109\101")x:SetAttributes({Foo=123})local d=x:OutAttribute("\070\111\111",456);(expect(d:Current())).to.equal(456)local b=H.Root(K)b:Render(x);(expect(d:Current())).to.equal(123)K:SetAttribute("\070\111\111",789);(expect(d:Current())).to.equal(789)b:Unmount()K:SetAttribute("\070\111\111",101112);(expect(d:Current())).to.equal(789)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 \097\116\116\114\105\098\117\116\101\115",function()local K=Instance.new("\070\114\097\109\101")K:SetAttribute("\070\111\111",123)local x=H.Premade("\070\114\097\109\101")x:SetAttributes({Foo=456})local d=x:OutInitialAttribute("\070\111\111",789);(expect(d:Current())).to.equal(789)local b=H.Root(K)b:Render(x);(expect(d:Current())).to.equal(123)b:Unmount()K:SetAttribute("\070\111\111",101112);(expect(d:Current())).to.equal(123)end)end)end
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Dex = require(ReplicatedStorage.Packages.Dex)
return function()
    describe("OutAttribute", function()
        it("Connects a listener to a rendered instance's attributes", function()
            local host = Instance.new("Frame")
            local virtualInstance = Dex.Premade("Frame")
            virtualInstance:SetAttributes({ Foo = 123 })
            
            local fooObs = virtualInstance:OutAttribute("Foo", 456)
            expect(fooObs:Current()).to.equal(456)

            local root = Dex.Root(host)
            root:Render(virtualInstance)
            expect(fooObs:Current()).to.equal(123)
        
            host:SetAttribute("Foo", 789)
            expect(fooObs:Current()).to.equal(789)

            root:Unmount()
            host:SetAttribute("Foo", 10_11_12)
            expect(fooObs:Current()).to.equal(789)
        end)
        it("Connects a listener to an instance's initial (pre-mount) attributes", function()
            local host = Instance.new("Frame")
            host:SetAttribute("Foo", 123)
            local virtualInstance = Dex.Premade("Frame")
            virtualInstance:SetAttributes({ Foo = 456 })
            
            local fooObs = virtualInstance:OutInitialAttribute("Foo", 789)
            expect(fooObs:Current()).to.equal(789)

            local root = Dex.Root(host)
            root:Render(virtualInstance)
            expect(fooObs:Current()).to.equal(123)

            root:Unmount()
            host:SetAttribute("Foo", 10_11_12)
            expect(fooObs:Current()).to.equal(123)
        end)
    end)
end