|
|
@ -322,14 +322,14 @@ describe("OPDS module #nocov", function()
|
|
|
|
|
|
|
|
|
|
|
|
describe("OPDS browser module", function()
|
|
|
|
describe("OPDS browser module", function()
|
|
|
|
describe("URL generation", function()
|
|
|
|
describe("URL generation", function()
|
|
|
|
it("should generate search item", function()
|
|
|
|
it("should generate search item #internet", function()
|
|
|
|
local catalog = OPDSParser:parse(navigation_sample)
|
|
|
|
local catalog = OPDSParser:parse(navigation_sample)
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "https://www.gutenberg.org/ebooks.opds/?format=opds")
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "https://www.gutenberg.org/ebooks.opds/?format=opds")
|
|
|
|
|
|
|
|
|
|
|
|
assert.truthy(item_table)
|
|
|
|
assert.truthy(item_table)
|
|
|
|
assert.are.same(item_table[1].text, "\u{f002} " .. "Search")
|
|
|
|
assert.are.same(item_table[1].text, "\u{f002} " .. "Search")
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
it("should generate URL on rel=subsection", function()
|
|
|
|
it("should generate URL on rel=subsection #internet", function()
|
|
|
|
local catalog = OPDSParser:parse(navigation_sample)
|
|
|
|
local catalog = OPDSParser:parse(navigation_sample)
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "https://www.gutenberg.org/ebooks.opds/?format=opds")
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "https://www.gutenberg.org/ebooks.opds/?format=opds")
|
|
|
|
|
|
|
|
|
|
|
@ -337,7 +337,7 @@ describe("OPDS module #nocov", function()
|
|
|
|
assert.are.same(item_table[2].title, "Popular")
|
|
|
|
assert.are.same(item_table[2].title, "Popular")
|
|
|
|
assert.are.same(item_table[2].url, "https://www.gutenberg.org/ebooks/search.opds/?sort_order=downloads")
|
|
|
|
assert.are.same(item_table[2].url, "https://www.gutenberg.org/ebooks/search.opds/?sort_order=downloads")
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
it("should generate URL on rel=popular and rel=new", function()
|
|
|
|
it("should generate URL on rel=popular and rel=new #internet", function()
|
|
|
|
local catalog = OPDSParser:parse(popular_new_sample)
|
|
|
|
local catalog = OPDSParser:parse(popular_new_sample)
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://www.feedbooks.com/publicdomain/catalog.atom")
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://www.feedbooks.com/publicdomain/catalog.atom")
|
|
|
|
|
|
|
|
|
|
|
@ -347,7 +347,7 @@ describe("OPDS module #nocov", function()
|
|
|
|
assert.are.same(item_table[3].title, "Recently Added")
|
|
|
|
assert.are.same(item_table[3].title, "Recently Added")
|
|
|
|
assert.are.same(item_table[3].url, "http://www.feedbooks.com/books/recent.atom")
|
|
|
|
assert.are.same(item_table[3].url, "http://www.feedbooks.com/books/recent.atom")
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
it("should use the main URL for faceted links as long as faceted links aren't properly supported", function()
|
|
|
|
it("should use the main URL for faceted links as long as faceted links aren't properly supported #internet", function()
|
|
|
|
local catalog = OPDSParser:parse(facet_sample)
|
|
|
|
local catalog = OPDSParser:parse(facet_sample)
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.is/opds")
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.is/opds")
|
|
|
|
|
|
|
|
|
|
|
@ -356,7 +356,7 @@ describe("OPDS module #nocov", function()
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
it("should not fill item table incorrectly with thumbnail or image URL", function()
|
|
|
|
it("should not fill item table incorrectly with thumbnail or image URL #internet", function()
|
|
|
|
local catalog = OPDSParser:parse(facet_sample)
|
|
|
|
local catalog = OPDSParser:parse(facet_sample)
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.is/opds")
|
|
|
|
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.is/opds")
|
|
|
|
|
|
|
|
|
|
|
|