[spec] Add ToggleSwitch spec stub (#5450)

To protect against issues like #5448.
pull/5458/head
Frans de Jonge 5 years ago committed by GitHub
parent 513fd807b0
commit 521c4251f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,26 @@
describe("ToggleSwitch module", function()
local ToggleSwitch
setup(function()
require("commonrequire")
ToggleSwitch = require("ui/widget/toggleswitch")
end)
it("should toggle without args", function()
local config = {
onConfigChoose = function() end,
}
local switch = ToggleSwitch:new{
event = "ChangeSpec",
default_value = 2,
toggle = { "Finished", "Reading", "On hold" },
values = { 1, 2, 3 },
name = "spec_status",
alternate = false,
enabled = true,
config = config,
}
switch:togglePosition(1, true)
switch:onTapSelect(3)
end)
end)
Loading…
Cancel
Save