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,14 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("AddError", function(error, timestamp)
error = error or {}
return {
error = {
Title = error.Title,
Msg = error.Msg,
Code = error.Code,
timestamp = timestamp
}
}
end)
@@ -0,0 +1,39 @@
return function()
it("should return a table", function()
local action = require(script.Parent.AddError)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.AddError)()
expect(action).to.be.a("table")
end)
it("should return a table with an error with same Title, Msg, Code set as the passed in error and aslo has the error timestamp appended", function()
local Modules = game:GetService("CoreGui").RobloxGui.Modules
local ShellModules = Modules:FindFirstChild("Shell")
local Errors = require(ShellModules:FindFirstChild('Errors'))
local DefaultError = Errors.Default
local action = require(script.Parent.AddError)(DefaultError, tick())
local error = action.error
expect(error).to.be.a("table")
expect(error.Title).to.equal(DefaultError.Title)
expect(error.Msg).to.equal(DefaultError.Msg)
expect(error.Code).to.equal(DefaultError.Code)
expect(error.timestamp).to.be.a("number")
end)
it("should set the name", function()
local action = require(script.Parent.AddError)
expect(action.name).to.equal("AddError")
end)
it("should set the type", function()
local action = require(script.Parent.AddError)()
expect(action.type).to.equal("AddError")
end)
end
@@ -0,0 +1,13 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("DeleteError", function(error)
error = error or {}
return {
error = {
Title = error.Title,
Msg = error.Msg,
Code = error.Code
}
}
end)
@@ -0,0 +1,38 @@
return function()
it("should return a table", function()
local action = require(script.Parent.DeleteError)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.DeleteError)()
expect(action).to.be.a("table")
end)
it("should return a table with an error with same Title, Msg, Code set as the passed in error", function()
local Modules = game:GetService("CoreGui").RobloxGui.Modules
local ShellModules = Modules:FindFirstChild("Shell")
local Errors = require(ShellModules:FindFirstChild('Errors'))
local DefaultError = Errors.Default
local action = require(script.Parent.DeleteError)(DefaultError)
local error = action.error
expect(error).to.be.a("table")
expect(error.Title).to.equal(DefaultError.Title)
expect(error.Msg).to.equal(DefaultError.Msg)
expect(error.Code).to.equal(DefaultError.Code)
end)
it("should set the name", function()
local action = require(script.Parent.DeleteError)
expect(action.name).to.equal("DeleteError")
end)
it("should set the type", function()
local action = require(script.Parent.DeleteError)()
expect(action.type).to.equal("DeleteError")
end)
end
@@ -0,0 +1,6 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("FetchPrivilegeSettings", function()
return {}
end)
@@ -0,0 +1,25 @@
return function()
it("should return a table", function()
local action = require(script.Parent.FetchPrivilegeSettings)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.FetchPrivilegeSettings)()
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.FetchPrivilegeSettings)
expect(action.name).to.equal("FetchPrivilegeSettings")
end)
it("should set the type", function()
local action = require(script.Parent.FetchPrivilegeSettings)()
expect(action.type).to.equal("FetchPrivilegeSettings")
end)
end
@@ -0,0 +1,11 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("FetchUserThumbnail", function(thumbnailInfo)
thumbnailInfo = thumbnailInfo or {}
return {
rbxuid = thumbnailInfo.rbxuid,
thumbnailType = thumbnailInfo.thumbnailType,
thumbnailSize = thumbnailInfo.thumbnailSize
}
end)
@@ -0,0 +1,39 @@
return function()
it("should return a table", function()
local action = require(script.Parent.FetchUserThumbnail)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.FetchUserThumbnail)()
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.FetchUserThumbnail)
expect(action.name).to.equal("FetchUserThumbnail")
end)
it("should set the rbxuid, thumbnailType and thumbnailSize", function()
local action = require(script.Parent.FetchUserThumbnail)(
{
rbxuid = 12345,
thumbnailType = Enum.ThumbnailType.HeadShot,
thumbnailSize = Enum.ThumbnailSize.Size180x180
})
expect(action.rbxuid).to.equal(12345)
expect(action.thumbnailType).to.equal(Enum.ThumbnailType.HeadShot)
expect(action.thumbnailSize).to.equal(Enum.ThumbnailSize.Size180x180)
end)
it("should set the type", function()
local action = require(script.Parent.FetchUserThumbnail)()
expect(action.type).to.equal("FetchUserThumbnail")
end)
end
@@ -0,0 +1,6 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("GetCrossPlayEnabledFailed", function()
return {}
end)
@@ -0,0 +1,25 @@
return function()
it("should return a table", function()
local action = require(script.Parent.GetCrossPlayEnabledFailed)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.GetCrossPlayEnabledFailed)()
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.GetCrossPlayEnabledFailed)
expect(action.name).to.equal("GetCrossPlayEnabledFailed")
end)
it("should set the type", function()
local action = require(script.Parent.GetCrossPlayEnabledFailed)()
expect(action.type).to.equal("GetCrossPlayEnabledFailed")
end)
end
@@ -0,0 +1,8 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("InsertScreen", function(item)
return {
item = item,
}
end)
@@ -0,0 +1,44 @@
return function()
describe("require", function()
it("should create without errors", function()
require(script.Parent.InsertScreen)
end)
it("should set the name", function()
local action = require(script.Parent.InsertScreen)
expect(action.name).to.equal("InsertScreen")
end)
end)
describe("call", function()
it("should return a table when called as a function", function()
local action = require(script.Parent.InsertScreen)
action = action({})
expect(action).to.be.a("table")
end)
it("should set the type", function()
local action = require(script.Parent.InsertScreen)
action = action({})
expect(action.type).to.equal("InsertScreen")
end)
it("should set the item", function()
local action = require(script.Parent.InsertScreen)
local item = "foo"
action = action(item)
expect(action.item).to.equal("foo")
end)
it("should set the type and name to be equal", function()
local action = require(script.Parent.InsertScreen)
local actionItem = action({})
expect(actionItem.type).to.equal(action.name)
end)
end)
end
@@ -0,0 +1,6 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("PostCrossPlayEnabledFailed", function()
return {}
end)
@@ -0,0 +1,25 @@
return function()
it("should return a table", function()
local action = require(script.Parent.PostCrossPlayEnabledFailed)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.PostCrossPlayEnabledFailed)()
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.PostCrossPlayEnabledFailed)
expect(action.name).to.equal("PostCrossPlayEnabledFailed")
end)
it("should set the type", function()
local action = require(script.Parent.PostCrossPlayEnabledFailed)()
expect(action.type).to.equal("PostCrossPlayEnabledFailed")
end)
end
@@ -0,0 +1,8 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("RemoveScreen", function(item)
return {
item = item,
}
end)
@@ -0,0 +1,44 @@
return function()
describe("require", function()
it("should create without errors", function()
require(script.Parent.RemoveScreen)
end)
it("should set the name", function()
local action = require(script.Parent.RemoveScreen)
expect(action.name).to.equal("RemoveScreen")
end)
end)
describe("call", function()
it("should return a table when called as a function", function()
local action = require(script.Parent.RemoveScreen)
action = action({})
expect(action).to.be.a("table")
end)
it("should set the type", function()
local action = require(script.Parent.RemoveScreen)
action = action({})
expect(action.type).to.equal("RemoveScreen")
end)
it("should set the item", function()
local action = require(script.Parent.RemoveScreen)
local item = "foo"
action = action(item)
expect(action.item).to.equal("foo")
end)
it("should set the type and name to be equal", function()
local action = require(script.Parent.RemoveScreen)
local actionItem = action({})
expect(actionItem.type).to.equal(action.name)
end)
end)
end
@@ -0,0 +1,6 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("RequestCrossPlayEnabled", function()
return {}
end)
@@ -0,0 +1,25 @@
return function()
it("should return a table", function()
local action = require(script.Parent.RequestCrossPlayEnabled)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.RequestCrossPlayEnabled)()
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.RequestCrossPlayEnabled)
expect(action.name).to.equal("RequestCrossPlayEnabled")
end)
it("should set the type", function()
local action = require(script.Parent.RequestCrossPlayEnabled)()
expect(action.type).to.equal("RequestCrossPlayEnabled")
end)
end
@@ -0,0 +1,6 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("ResetUserThumbnails", function()
return {}
end)
@@ -0,0 +1,25 @@
return function()
it("should return a table", function()
local action = require(script.Parent.ResetUserThumbnails)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.ResetUserThumbnails)()
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.ResetUserThumbnails)
expect(action.name).to.equal("ResetUserThumbnails")
end)
it("should set the type", function()
local action = require(script.Parent.ResetUserThumbnails)()
expect(action.type).to.equal("ResetUserThumbnails")
end)
end
@@ -0,0 +1,9 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("SetCrossPlayEnabled", function(enabled, timestamp)
return {
enabled = enabled,
timestamp = timestamp
}
end)
@@ -0,0 +1,32 @@
return function()
it("should return a table", function()
local action = require(script.Parent.SetCrossPlayEnabled)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.SetCrossPlayEnabled)()
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.SetCrossPlayEnabled)
expect(action.name).to.equal("SetCrossPlayEnabled")
end)
it("should set the enabled value and timestamp", function()
local action = require(script.Parent.SetCrossPlayEnabled)(true, 10)
expect(action.enabled).to.equal(true)
expect(action.timestamp).to.equal(10)
end)
it("should set the type", function()
local action = require(script.Parent.SetCrossPlayEnabled)()
expect(action.type).to.equal("SetCrossPlayEnabled")
end)
end
@@ -0,0 +1,22 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
--[[
// friendsData is table
// Table keys:
// [index number] - table
// xuid - number
// robloxName - string
// placeId - number
// robloxStatus - string
// robloxuid - number
// lastLocation - string
// gamertag - string
// xboxStatus - string
// friendsSource - string
]]
return Action("SetFriendsData", function(friendsData)
return {
data = friendsData
}
end)
@@ -0,0 +1,39 @@
return function()
it("should return a table", function()
local action = require(script.Parent.SetFriendsData)
expect(action).to.be.a("table")
end)
it("should return a table without data when passed nil", function()
local action = require(script.Parent.SetFriendsData)()
expect(action).to.be.a("table")
expect(action.data).to.equal(nil)
end)
it("should set the name", function()
local action = require(script.Parent.SetFriendsData)
expect(action.name).to.equal("SetFriendsData")
end)
it("should set the elements at the first depth", function()
local action = require(script.Parent.SetFriendsData)( { {}, {} } )
expect(action.data[2]).to.be.a("table")
end)
it("should set the elements at the second depth", function()
local action = require(script.Parent.SetFriendsData)( { { a="A", b="B" } } )
expect(action.data[1]).to.be.a("table")
expect(action.data[1].a).to.equal("A")
end)
it("should set the type", function()
local action = require(script.Parent.SetFriendsData)()
expect(action.type).to.equal("SetFriendsData")
end)
end
@@ -0,0 +1,12 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("SetPrivilegeSettings", function(privilegeSettings)
privilegeSettings = privilegeSettings or {}
return
{
Multiplayer = privilegeSettings.Multiplayer,
SharedContent = privilegeSettings.SharedContent,
timestamp = privilegeSettings.timestamp
}
end)
@@ -0,0 +1,33 @@
return function()
it("should return a table", function()
local action = require(script.Parent.SetPrivilegeSettings)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.SetPrivilegeSettings)()
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.SetPrivilegeSettings)
expect(action.name).to.equal("SetPrivilegeSettings")
end)
it("should set the privilege settings and timestamp", function()
local action = require(script.Parent.SetPrivilegeSettings)({Multiplayer = {}, SharedContent = {}, timestamp = 10})
expect(action.Multiplayer).to.be.a("table")
expect(action.SharedContent).to.be.a("table")
expect(action.timestamp).to.equal(10)
end)
it("should set the type", function()
local action = require(script.Parent.SetPrivilegeSettings)()
expect(action.type).to.equal("SetPrivilegeSettings")
end)
end
@@ -0,0 +1,22 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
--[[
// friendsData is table
// Table keys:
// [index number] - table
// xuid - number
// robloxName - string
// placeId - number
// robloxStatus - string
// robloxuid - number
// lastLocation - string
// gamertag - string
// xboxStatus - string
// friendsSource - string
]]
return Action("SetRenderedFriendsData", function(friendsData)
return {
data = friendsData
}
end)
@@ -0,0 +1,39 @@
return function()
it("should return a table", function()
local action = require(script.Parent.SetRenderedFriendsData)
expect(action).to.be.a("table")
end)
it("should return a table without data when passed nil", function()
local action = require(script.Parent.SetRenderedFriendsData)()
expect(action).to.be.a("table")
expect(action.data).to.equal(nil)
end)
it("should set the name", function()
local action = require(script.Parent.SetRenderedFriendsData)
expect(action.name).to.equal("SetRenderedFriendsData")
end)
it("should set the elements at the first depth", function()
local action = require(script.Parent.SetRenderedFriendsData)( { {}, {} } )
expect(action.data[2]).to.be.a("table")
end)
it("should set the elements at the second depth", function()
local action = require(script.Parent.SetRenderedFriendsData)( { { a="A", b="B" } } )
expect(action.data[1]).to.be.a("table")
expect(action.data[1].a).to.equal("A")
end)
it("should set the type", function()
local action = require(script.Parent.SetRenderedFriendsData)()
expect(action.type).to.equal("SetRenderedFriendsData")
end)
end
@@ -0,0 +1,11 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("SetRobloxUser", function(userInfo)
userInfo = userInfo or {}
return {
robloxName = userInfo.robloxName,
rbxuid = userInfo.rbxuid,
under13 = userInfo.under13
}
end)
@@ -0,0 +1,44 @@
return function()
it("should return a table", function()
local action = require(script.Parent.SetRobloxUser)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.SetRobloxUser)({robloxName="TestRobloxName", rbxuid=12345, under13 = true})
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.SetRobloxUser)
expect(action.name).to.equal("SetRobloxUser")
end)
it("should set the robloxName, rbxuid, and under13 values", function()
local action = require(script.Parent.SetRobloxUser)({robloxName="TestRobloxName", rbxuid=12345, under13 = true})
expect(action.robloxName).to.be.a("string")
expect(action.robloxName).to.equal("TestRobloxName")
expect(action.rbxuid).to.be.a("number")
expect(action.rbxuid).to.equal(12345)
expect(action.under13).to.be.a("boolean")
expect(action.under13).to.equal(true)
end)
it("should set the robloxName, rbxuid, and under13 values to nil when passed an empty table", function()
local action = require(script.Parent.SetRobloxUser)({})
expect(action.robloxName).to.equal(nil)
expect(action.rbxuid).to.equal(nil)
expect(action.under13).to.equal(nil)
end)
it("should set the type", function()
local action = require(script.Parent.SetRobloxUser)({robloxName="TestRobloxName", rbxuid=12345, under13 = true})
expect(action.type).to.equal("SetRobloxUser")
end)
end
@@ -0,0 +1,15 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("SetUserThumbnail", function(thumbnailInfo)
thumbnailInfo = thumbnailInfo or {}
return {
success = thumbnailInfo.success,
rbxuid = thumbnailInfo.rbxuid,
imageUrl = thumbnailInfo.imageUrl,
thumbnailType = thumbnailInfo.thumbnailType,
thumbnailSize = thumbnailInfo.thumbnailSize,
isFinal = thumbnailInfo.isFinal,
timestamp = thumbnailInfo.timestamp
}
end)
@@ -0,0 +1,10 @@
local CoreGui = game:GetService("CoreGui")
local Action = require(CoreGui.RobloxGui.Modules.Common.Action)
return Action("SetXboxUser", function(userInfo)
userInfo = userInfo or {}
return {
gamertag = userInfo.gamertag,
xuid = userInfo.xuid
}
end)
@@ -0,0 +1,41 @@
return function()
it("should return a table", function()
local action = require(script.Parent.SetXboxUser)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.SetXboxUser)({gamertag="TestGamerTag", xuid=12345})
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.SetXboxUser)
expect(action.name).to.equal("SetXboxUser")
end)
it("should set the gamertag and xuid values", function()
local action = require(script.Parent.SetXboxUser)({gamertag="TestGamerTag", xuid=12345})
expect(action.gamertag).to.be.a("string")
expect(action.gamertag).to.equal("TestGamerTag")
expect(action.xuid).to.be.a("number")
expect(action.xuid).to.equal(12345)
end)
it("should set gamertag and xuid to nil if passed an empty table", function()
local action = require(script.Parent.SetXboxUser)({})
expect(action.gamertag).to.equal(nil)
expect(action.xuid).to.equal(nil)
end)
it("should set the type", function()
local action = require(script.Parent.SetXboxUser)({gamertag="TestGamerTag", xuid=12345})
expect(action.type).to.equal("SetXboxUser")
end)
end
@@ -0,0 +1,65 @@
return function()
it("should return a table", function()
local action = require(script.Parent.SetUserThumbnail)
expect(action).to.be.a("table")
end)
it("should return a table when called as a function", function()
local action = require(script.Parent.SetUserThumbnail)(
{
success = true,
rbxuid = 12345,
imageUrl = "x",
thumbnailType = Enum.ThumbnailType.HeadShot,
thumbnailSize = Enum.ThumbnailSize.Size180x180,
isFinal = true,
timestamp = 10
})
expect(action).to.be.a("table")
end)
it("should set the name", function()
local action = require(script.Parent.SetUserThumbnail)
expect(action.name).to.equal("SetUserThumbnail")
end)
it("should set the success, rbxuid, imageUrl, thumbnailType, thumbnailSize and isFinal values", function()
local action = require(script.Parent.SetUserThumbnail)(
{
rbxuid = 12345,
thumbnailType = Enum.ThumbnailType.HeadShot,
thumbnailSize = Enum.ThumbnailSize.Size180x180,
success = true,
imageUrl = "x",
isFinal = true,
timestamp = 10
})
expect(action.success).to.equal(true)
expect(action.rbxuid).to.equal(12345)
expect(action.imageUrl).to.equal("x")
expect(action.thumbnailType).to.equal(Enum.ThumbnailType.HeadShot)
expect(action.thumbnailSize).to.equal(Enum.ThumbnailSize.Size180x180)
expect(action.isFinal).to.equal(true)
expect(action.timestamp).to.equal(10)
end)
it("should set the success, rbxuid, imageUrl, thumbnailType, thumbnailSize and isFinal to nil if passed an empty table", function()
local action = require(script.Parent.SetUserThumbnail)({})
expect(action.success).never.to.be.ok()
expect(action.rbxuid).never.to.be.ok()
expect(action.imageUrl).never.to.be.ok()
expect(action.thumbnailType).never.to.be.ok()
expect(action.thumbnailSize).never.to.be.ok()
expect(action.isFinal).never.to.be.ok()
end)
it("should set the type", function()
local action = require(script.Parent.SetUserThumbnail)({})
expect(action.type).to.equal("SetUserThumbnail")
end)
end