|
|
|
@ -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}
|
|
|
|
|