2014-12-18 08:32:18 +00:00
|
|
|
describe("ImageWidget module", function()
|
2016-04-19 06:50:36 +00:00
|
|
|
local ImageWidget
|
|
|
|
setup(function()
|
|
|
|
require("commonrequire")
|
|
|
|
ImageWidget = require("ui/widget/imagewidget")
|
|
|
|
end)
|
|
|
|
|
2014-12-18 08:32:18 +00:00
|
|
|
it("should render without error", function()
|
|
|
|
local imgw = ImageWidget:new{
|
2020-12-19 11:18:30 +00:00
|
|
|
file = "resources/koreader.png"
|
2014-12-18 08:32:18 +00:00
|
|
|
}
|
|
|
|
imgw:_render()
|
|
|
|
assert(imgw._bb)
|
|
|
|
end)
|
|
|
|
it("should error out on none exist image", function()
|
|
|
|
local imgw = ImageWidget:new{
|
|
|
|
file = "wtf.png"
|
|
|
|
}
|
|
|
|
assert.has_error(function()
|
|
|
|
imgw:_render()
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|