add gs
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
local CorePackages = game:GetService("CorePackages")
|
||||
|
||||
return function()
|
||||
local Roact = require(CorePackages.Roact)
|
||||
local Dropdown = require(script.Parent.Parent.Components.Dropdown)
|
||||
|
||||
it("mounts and unmounts", function()
|
||||
local handle = Roact.mount(Roact.createElement(Dropdown, {
|
||||
ListItems = {},
|
||||
}))
|
||||
|
||||
Roact.unmount(handle)
|
||||
end)
|
||||
|
||||
itFIXME("inits with an item list and includes the default value in the resulting UI", function()
|
||||
local container = Instance.new("Frame")
|
||||
|
||||
local element = Roact.createElement(Dropdown, {
|
||||
CurrentText = "Option 1 (default)",
|
||||
ListItems = {
|
||||
"Option 1",
|
||||
"Option 2"
|
||||
},
|
||||
})
|
||||
|
||||
local handle = Roact.mount(element, container)
|
||||
expect(container.Frame.button.textLabel.Text).to.equal("Option 1 (default)")
|
||||
Roact.unmount(handle)
|
||||
end)
|
||||
end
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
local CorePackages = game:GetService("CorePackages")
|
||||
|
||||
return function()
|
||||
local Roact = require(CorePackages.Roact)
|
||||
local LabeledLocaleSelector = require(script.Parent.Parent.Components.LabeledLocaleSelector)
|
||||
|
||||
it("mounts and unmounts", function()
|
||||
local element = Roact.createElement(LabeledLocaleSelector)
|
||||
local handle = Roact.mount(element)
|
||||
Roact.unmount(handle)
|
||||
end)
|
||||
|
||||
it("inits with label text and displays that label text", function()
|
||||
local container = Instance.new("Frame")
|
||||
|
||||
local element = Roact.createElement(LabeledLocaleSelector, {
|
||||
LabelText = "Choose your locale"
|
||||
})
|
||||
|
||||
local handle = Roact.mount(element, container)
|
||||
expect(container.Frame.LocaleIdLabel.Text).to.equal("Choose your locale")
|
||||
Roact.unmount(handle)
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,32 @@
|
||||
local CorePackages = game:GetService("CorePackages")
|
||||
|
||||
local function recursivePrint(node, indent)
|
||||
indent = indent or ""
|
||||
for _, child in pairs(node:GetChildren()) do
|
||||
print("|"..indent..tostring( child.Name ))
|
||||
recursivePrint(child, indent.." ")
|
||||
end
|
||||
end
|
||||
|
||||
return function()
|
||||
local Roact = require(CorePackages.Roact)
|
||||
local LocaleSelector = require(script.Parent.Parent.Components.LocaleSelector)
|
||||
|
||||
it("mounts and unmounts", function()
|
||||
local element = Roact.createElement(LocaleSelector)
|
||||
local handle = Roact.mount(element)
|
||||
Roact.unmount(handle)
|
||||
end)
|
||||
|
||||
it("inits with a selected locale and displays that locale", function()
|
||||
local container = Instance.new("Frame")
|
||||
|
||||
local element = Roact.createElement(LocaleSelector, {
|
||||
InitialLocaleId = "kw-gb"
|
||||
})
|
||||
|
||||
local handle = Roact.mount(element, container)
|
||||
expect(container.Frame.LocaleIdTextBox.TextboxInternal.Text).to.equal("kw-gb")
|
||||
Roact.unmount(handle)
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
local CorePackages = game:GetService("CorePackages")
|
||||
|
||||
return function()
|
||||
local Roact = require(CorePackages.Roact)
|
||||
local Modalifier = require(script.Parent.Parent.Components.Modalifier)
|
||||
|
||||
it("mounts and unmounts and puts the curtain up", function()
|
||||
local container = Instance.new("Frame")
|
||||
local element = Roact.createElement(Modalifier, {
|
||||
Window = container
|
||||
})
|
||||
local handle = Roact.mount(element)
|
||||
expect(container.Curtain).to.be.ok()
|
||||
Roact.unmount(handle)
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
local CorePackages = game:GetService("CorePackages")
|
||||
|
||||
return function()
|
||||
local Roact = require(CorePackages.Roact)
|
||||
local PlayerLocaleView = require(script.Parent.Parent.Components.PlayerLocaleView)
|
||||
|
||||
itFIXME("mounts and unmounts", function()
|
||||
-- With --fflags==true throws error: Studio is not a valid member of GlobalSettings
|
||||
local element = Roact.createElement(PlayerLocaleView)
|
||||
local handle = Roact.mount(element)
|
||||
Roact.unmount(handle)
|
||||
end)
|
||||
end
|
||||
Reference in New Issue
Block a user