Update readerbookmark_spec.lua

reviewable/pr11563/r8
hius07 1 month ago committed by GitHub
parent 5fbe6cb731
commit 87c1bab61b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -103,6 +103,7 @@ describe("ReaderBookmark module", function()
assert.are.same(5, #readerui.annotation.annotations)
end)
it("should add bookmark by highlighting", function()
readerui.rolling:onGotoPage(20)
highlight_text(readerui,
Geom:new{ x = 260, y = 60 },
Geom:new{ x = 260, y = 90 })
@ -114,7 +115,7 @@ describe("ReaderBookmark module", function()
it("should get previous bookmark for certain page", function()
local xpointer = readerui.document:getXPointer()
local bm_xpointer = readerui.bookmark:getPreviousBookmarkedPage(xpointer)
assert.are.same(6, #readerui.bookmark.bookmarks)
assert.are.same(6, #readerui.annotation.annotations)
assert.are.same(15, readerui.document:getPageFromXPointer(bm_xpointer))
end)
it("should get next bookmark for certain page", function()
@ -163,7 +164,7 @@ describe("ReaderBookmark module", function()
show_bookmark_menu(readerui)
Screen:shot("screenshots/reader_bookmark_10marks_pdf.png")
assert.are.same(10, #readerui.annotation.annotations)
assert.are.same(15, readerui.document:getPageFromXPointer(readerui.annotation.annotations[4].page))
assert.are.same(15, readerui.annotation.annotations[4].page)
end)
it("should keep descending page numbers after removing bookmarks", function()
local pages = {1, 30, 10, 40, 20}

Loading…
Cancel
Save