Skip to content

Commit

Permalink
Move cov
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarber committed May 29, 2018
1 parent b57b4f7 commit fe2f691
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 43 deletions.
19 changes: 7 additions & 12 deletions src/Models/Core/MainModule/UI/Components/AssetItem.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local Roact = require(script.Parent.Parent.Parent.lib.Roact)

return function()
local AssetItem = require(script.Parent.AssetItem)

Expand All @@ -6,18 +8,11 @@ return function()
expect(AssetItem).to.be.ok()
end)

it("should init", function()
--- @TODO we currently can't emulate marketplace service
expect(function()
AssetItem:init()
end).to.throw()
end)

it("should render", function()
--- @TODO we need init to work first
expect(function()
AssetItem:render()
end).to.throw()
--- @TODO breaks trying to get MarketplaceService
itSKIP("should mount and unmount", function()
local d = Roact.createElement(AssetItem)
local h = Roact.mount(d)
Roact.unmount(h)
end)
end)
end
15 changes: 8 additions & 7 deletions src/Models/Core/MainModule/UI/Components/AssetsWidget.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local Roact = require(script.Parent.Parent.Parent.lib.Roact)

return function()
local AssetsWidget = require(script.Parent.AssetsWidget)

Expand All @@ -6,14 +8,13 @@ return function()
expect(AssetsWidget).to.be.ok()
end)

it("should new ok", function()
expect(AssetsWidget:init({
--- @TODO needs support for UITextSizeConstrainer in lemur
itSKIP("should mount and unmount", function()
local d = Roact.createElement(AssetsWidget, {
Plugin = "foo",
})).never.to.be.ok()
end)

it("should render", function()
expect(AssetsWidget:render()).to.be.ok()
})
local h = Roact.mount(d)
Roact.unmount(h)
end)
end)
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local Roact = require(script.Parent.Parent.Parent.lib.Roact)

return function()
local ConfigurationWidget = require(script.Parent.ConfigurationWidget)

Expand All @@ -6,12 +8,10 @@ return function()
expect(ConfigurationWidget).to.be.ok()
end)

it("should init", function()
expect(ConfigurationWidget:init({})).never.to.be.ok()
end)

it("should render", function()
expect(ConfigurationWidget:render()).to.be.ok()
it("should mount and unmount", function()
local d = Roact.createElement(ConfigurationWidget)
local h = Roact.mount(d)
Roact.unmount(h)
end)
end)
end
5 changes: 0 additions & 5 deletions src/Models/Core/MainModule/UI/Components/Dropdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ function Dropdown:render()
BorderSizePixel = 0,
Text = item,
Size = UDim2.new(1, 0, 0, 20),
ZIndex = 5,
[Roact.Event.MouseButton1Click] = function(_)
if self.state.ChangeFn ~= nil then
Expand All @@ -45,7 +44,6 @@ function Dropdown:render()
return c("TextButton", {
Size = UDim2.new(0, 200, 0, 30),
Text = "",
ZIndex = 5,
[Roact.Event.MouseButton1Click] = function(_)
self:setState({
Expand All @@ -70,8 +68,6 @@ function Dropdown:render()
Text = self.state.CurrentItem or "select an item",
Font = Enum.Font.SourceSans,
TextSize = 18,
TextScaled = true,
ZIndex = 6,
}, {
c("UITextSizeConstraint", {
MaxTextSize = 18,
Expand All @@ -81,7 +77,6 @@ function Dropdown:render()
Visible = self.state.Open,
Size = UDim2.new(1, 0, 0, 100),
Position = UDim2.new(0, 0, 1, 0),
ZIndex = 5,
}, {
c("UIListLayout"),
unpack(items),
Expand Down
15 changes: 9 additions & 6 deletions src/Models/Core/MainModule/UI/Components/Dropdown.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local Roact = require(script.Parent.Parent.Parent.lib.Roact)

return function()
local Dropdown = require(script.Parent.Dropdown)

Expand All @@ -6,12 +8,13 @@ return function()
expect(Dropdown).to.be.ok()
end)

it("should new ok", function()
expect(Dropdown:init({})).never.to.be.ok()
end)

it("should render", function()
expect(Dropdown:render()).to.be.ok()
--- @TODO Support UITextSizeConstraint in lemur
itSKIP("should mount and unmount", function()
local d = Roact.createElement(Dropdown, {
Items = {"foo"},
})
local h = Roact.mount(d)
Roact.unmount(h)
end)
end)
end
16 changes: 9 additions & 7 deletions src/Models/Core/MainModule/UI/Components/TextLabel.spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local Roact = require(script.Parent.Parent.Parent.lib.Roact)

return function()
local TextLabel = require(script.Parent.TextLabel)

Expand All @@ -6,13 +8,13 @@ return function()
expect(TextLabel).to.be.ok()
end)

it("should new ok", function()
expect(TextLabel:init({})).never.to.be.ok()
end)

it("should render", function()
expect(TextLabel:render()).to.be.ok()
it("should mount and unmount", function()
local d = Roact.createElement(TextLabel, {
Size = UDim2.new(0,0,0,0),
Text = "foo",
})
local h = Roact.mount(d)
Roact.unmount(h)
end)

end)
end

0 comments on commit fe2f691

Please sign in to comment.