2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
koreader/spec/unit/readerdictionary_spec.lua
yparitcher f7d538b108
Landscape FM / Refactor rotation (#6309)
* landscape FM / Refactor rotation

refactor and simplify the orientation handling code. the user generally cares about the rotation (what direction the device is facing) and not about if koreader is displaying in portrait or landscape mode

* bump base

update luasocket, libjpeg-turbo, curl
add logging to evernote-sdk-lua
update framebuffer for proper rotation
2020-07-01 16:17:41 -04:00

36 lines
1.1 KiB
Lua

describe("Readerdictionary module", function()
local DocumentRegistry, ReaderUI, UIManager, Screen
setup(function()
require("commonrequire")
DocumentRegistry = require("document/documentregistry")
ReaderUI = require("apps/reader/readerui")
UIManager = require("ui/uimanager")
Screen = require("device").screen
end)
local readerui, rolling, dictionary
setup(function()
local sample_epub = "spec/front/unit/data/leaves.epub"
readerui = ReaderUI:new{
dimen = Screen:getSize(),
document = DocumentRegistry:openDocument(sample_epub),
}
rolling = readerui.rolling
dictionary = readerui.dictionary
end)
it("should show quick lookup window", function()
local name = "screenshots/reader_dictionary.png"
UIManager:quit()
UIManager:show(readerui)
rolling:onGotoPage(100)
dictionary:onLookupWord("test")
UIManager:scheduleIn(1, function()
UIManager:close(dictionary.dict_window)
UIManager:close(readerui)
end)
UIManager:run()
Screen:shot(name)
end)
end)