diff --git a/src/init.spec.lua b/src/init.spec.lua new file mode 100644 index 0000000..6e60f35 --- /dev/null +++ b/src/init.spec.lua @@ -0,0 +1,41 @@ +return function() + local Satchel = require(script.Parent) + + describe("Methods", function() + it("SetBackpackEnabled(false)", function() + Satchel:SetBackpackEnabled(false) + expect(Satchel:GetBackpackEnabled()).to.equal(false) + end) + it("SetBackpackEnabled(true)", function() + Satchel:SetBackpackEnabled(true) + expect(Satchel:GetBackpackEnabled()).to.equal(true) + end) + it("GetBackpackEnabled", function() + local getBackpackEnabled = Satchel:GetBackpackEnabled() + expect(getBackpackEnabled).to.be.a("boolean") + end) + it("IsOpened", function() + local isOpened = Satchel:IsOpened() + expect(isOpened).to.be.a("boolean") + end) + it("GetStateChangedEvent", function() + local getStateChangedEvent = Satchel:GetStateChangedEvent() + expect(getStateChangedEvent).to.be.a("userdata") + end) + end) + -- TODO: Fix these tests + describe("Events", function() + -- it("StateChanged", function() + -- Satchel.StateChanged.to.be.a("userdata") + -- end) + -- it("BackpackEmpty", function() + -- Satchel.BackpackEmpty.to.be.a("userdata") + -- end) + -- it("BackpackItemAdded", function() + -- Satchel.BackpackItemAdded.to.be.a("userdata") + -- end) + -- it("BackpackItemRemoved", function() + -- Satchel.BackpackItemRemoved.to.be.a("userdata") + -- end) + end) +end