local W=require((((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\078\101\120\117\115\066\117\116\116\111\110")):WaitForChild("\070\097\099\116\111\114\121")):WaitForChild("\084\101\120\116\066\117\116\116\111\110\070\097\099\116\111\114\121"))return function()describe("\065 \116\101\120\116 \098\117\116\116\111\110 \102\097\099\116\111\114\121",function()it("\115\104\111\117\108\100 \115\101\116 \100\101\102\097\117\108\116 \112\114\111\112\101\114\116\105\101\115\046",function()local z=W.new()z:SetTextDefault("\084\101\120\116","\084\101\115\116\076\097\098\101\108")z:SetTextDefault("\070\111\110\116",Enum.Font.Arcade)local g,Q=z:Create();(expect(Q.Text)).to.equal("\084\101\115\116\076\097\098\101\108");(expect(Q.Font)).to.equal(Enum.Font.Arcade)g:Destroy()z:UnsetTextDefault("\084\101\120\116")local s,t=z:Create();(expect(t.Text)).never.to.equal("\084\101\115\116\076\097\098\101\108");(expect(t.Font)).to.equal(Enum.Font.Arcade)s:Destroy()end)it("\115\104\111\117\108\100 \098\101 \099\114\101\097\116\101\100 \102\114\111\109 \097 \100\101\102\097\117\108\116 \112\114\101\115\101\116\046",function()local z=W.CreateDefault(Color3.fromRGB(0,170,255))local g,Q=z:Create();(expect(g.BackgroundColor3)).to.equal(Color3.fromRGB(0,170,255));(expect(g.BorderColor3)).to.equal(Color3.fromRGB(0,140,225));(expect(g.BorderTransparency)).to.equal(.25);(expect(Q.Font)).to.equal(Enum.Font.SourceSans);(expect(Q.TextColor3)).to.equal(Color3.fromRGB(255,255,255));(expect(Q.TextStrokeColor3)).to.equal(Color3.fromRGB(0,0,0));(expect(Q.TextStrokeTransparency)).to.equal(0);(expect(Q.TextScaled)).to.equal(true)g:Destroy()end)end)end
--Tests the TextButtonFactory class.
--!strict

local TextButtonFactory = require(game:GetService("ReplicatedStorage"):WaitForChild("NexusButton"):WaitForChild("Factory"):WaitForChild("TextButtonFactory"))

return function()
    describe("A text button factory", function()
        it("should set default properties.", function()
            local TestButtonFactory = TextButtonFactory.new()
            TestButtonFactory:SetTextDefault("Text", "TestLabel")
            TestButtonFactory:SetTextDefault("Font", Enum.Font.Arcade)

            local Button1, TextLabel1 = TestButtonFactory:Create()
            expect(TextLabel1.Text).to.equal("TestLabel")
            expect(TextLabel1.Font).to.equal(Enum.Font.Arcade)
            Button1:Destroy()
        
            TestButtonFactory:UnsetTextDefault("Text")
            local Button2, TextLabel2 = TestButtonFactory:Create()
            expect(TextLabel2.Text).never.to.equal("TestLabel")
            expect(TextLabel2.Font).to.equal(Enum.Font.Arcade)
            Button2:Destroy()
        end)

        it("should be created from a default preset.", function()
            local TestButtonFactory = TextButtonFactory.CreateDefault(Color3.fromRGB(0, 170, 255))

            local Button, TextLabel = TestButtonFactory:Create()
            expect(Button.BackgroundColor3).to.equal(Color3.fromRGB(0, 170, 255))
            expect(Button.BorderColor3).to.equal(Color3.fromRGB(0, 140, 225))
            expect(Button.BorderTransparency).to.equal(0.25)
            expect(TextLabel.Font).to.equal(Enum.Font.SourceSans)
            expect(TextLabel.TextColor3).to.equal(Color3.fromRGB(255, 255, 255))
            expect(TextLabel.TextStrokeColor3).to.equal(Color3.fromRGB(0, 0, 0))
            expect(TextLabel.TextStrokeTransparency).to.equal(0)
            expect(TextLabel.TextScaled).to.equal(true)
            Button:Destroy()
        end)
    end)
end