mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
fix: only show reader status at the end of the book
This commit is contained in:
@@ -45,6 +45,17 @@ describe("Readerrolling module", function()
|
||||
assert.are.same(toc:getPreviousChapter(i, 0), rolling.current_page)
|
||||
end
|
||||
end)
|
||||
it("should emit EndOfBook event at the end", function()
|
||||
rolling:gotoPage(readerui.document:getPageCount())
|
||||
local called = false
|
||||
readerui.onEndOfBook = function()
|
||||
called = true
|
||||
end
|
||||
rolling:onGotoViewRel(1)
|
||||
rolling:onGotoViewRel(1)
|
||||
assert.is.truthy(called)
|
||||
readerui.onEndOfBook = nil
|
||||
end)
|
||||
end)
|
||||
describe("test in landscape screen mode", function()
|
||||
it("should go to landscape screen mode", function()
|
||||
@@ -81,6 +92,17 @@ describe("Readerrolling module", function()
|
||||
assert.are.same(toc:getPreviousChapter(i, 0), rolling.current_page)
|
||||
end
|
||||
end)
|
||||
it("should emit EndOfBook event at the end", function()
|
||||
rolling:gotoPage(readerui.document:getPageCount())
|
||||
local called = false
|
||||
readerui.onEndOfBook = function()
|
||||
called = true
|
||||
end
|
||||
rolling:onGotoViewRel(1)
|
||||
rolling:onGotoViewRel(1)
|
||||
assert.is.truthy(called)
|
||||
readerui.onEndOfBook = nil
|
||||
end)
|
||||
end)
|
||||
describe("switching screen mode should not change current page number", function()
|
||||
it("for portrait-landscape-portrait switching", function()
|
||||
|
||||
Reference in New Issue
Block a user