forked from koreader/koreader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
readerfooter_spec.lua
30 lines (28 loc) · 1.3 KB
/
readerfooter_spec.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require("commonrequire")
local DocumentRegistry = require("document/documentregistry")
local ReaderUI = require("apps/reader/readerui")
local DEBUG = require("dbg")
describe("Readerfooter module", function()
it("should setup footer for epub without error", function()
local sample_epub = "spec/front/unit/data/juliet.epub"
local readerui = ReaderUI:new{
document = DocumentRegistry:openDocument(sample_epub),
}
readerui.view.footer.settings.all_at_once = true
readerui.view.footer:updateFooterPage()
timeinfo = readerui.view.footer:getTimeInfo()
assert.are.same('B:0% | '..timeinfo..' | => 0 | R:100% | TB: 00:00 | TC: 00:00',
readerui.view.footer.progress_text.text)
end)
it("should setup footer for pdf without error", function()
local sample_pdf = "spec/front/unit/data/2col.pdf"
local readerui = ReaderUI:new{
document = DocumentRegistry:openDocument(sample_pdf),
}
readerui.view.footer.settings.all_at_once = true
readerui.view.footer:updateFooterPage()
timeinfo = readerui.view.footer:getTimeInfo()
assert.are.same('B:0% | '..timeinfo..' | => 1 | R:50% | TB: na | TC: na',
readerui.view.footer.progress_text.text)
end)
end)