This commit is contained in:
lx
2026-07-06 14:01:11 -04:00
commit c4f97d729d
16468 changed files with 935321 additions and 0 deletions
@@ -0,0 +1,42 @@
return function()
local CoreGui = game:GetService("CoreGui")
local Modules = CoreGui.RobloxGui.Modules
local LuaChat = Modules.LuaChat
local ShowToast = require(LuaChat.Actions.ShowToast)
local ToastComplete = require(LuaChat.Actions.ToastComplete)
local ToastReducer = require(script.Parent.Toast)
local ToastModel = require(LuaChat.Models.ToastModel)
describe("Action Toast", function()
it("should return nil when passed nil", function()
local state = ToastReducer(nil, {})
expect(state).to.equal(nil)
end)
it("Action ShowToast", function()
local state = ToastReducer(nil, {})
local myToast = ToastModel.new()
state = ToastReducer(state, ShowToast(myToast))
expect(state).to.equal(myToast)
end)
it("Action ToastComplete", function()
local state = ToastReducer(nil, {})
state = ToastReducer(state, ToastComplete())
expect(state).to.equal(nil)
end)
it("ToastComplete should clear current toast", function()
local state = ToastReducer(nil, {})
local myToast = ToastModel.new()
state = ToastReducer(state, ShowToast(myToast))
expect(state).to.equal(myToast)
state = ToastReducer(state, ToastComplete())
expect(state).to.equal(nil)
end)
end)
end