diff --git a/test/playwright/visual-regression/components/filters-sidebar.spec.ts-snapshots/filters-sidebar-filters-selected-rtl-linux.png b/test/playwright/visual-regression/components/filters-sidebar.spec.ts-snapshots/filters-sidebar-filters-selected-rtl-linux.png deleted file mode 100644 index 70148e4d5f..0000000000 Binary files a/test/playwright/visual-regression/components/filters-sidebar.spec.ts-snapshots/filters-sidebar-filters-selected-rtl-linux.png and /dev/null differ diff --git a/test/playwright/visual-regression/components/filters.spec.ts b/test/playwright/visual-regression/components/filters.spec.ts index 8320b46374..055957a6a2 100644 --- a/test/playwright/visual-regression/components/filters.spec.ts +++ b/test/playwright/visual-regression/components/filters.spec.ts @@ -1,14 +1,22 @@ -import { expect, test } from "@playwright/test" +import { expect, Page, test } from "@playwright/test" import { goToSearchTerm, languageDirections, - t, + pathWithDir, } from "~~/test/playwright/utils/navigation" import breakpoints from "~~/test/playwright/utils/breakpoints" test.describe.configure({ mode: "parallel" }) +const filtersCheckedUrl = + "search/image?q=birds&category=photograph,illustration,digitized_artwork&extension=jpg,png,gif,svg&aspect_ratio=tall,wide,square&size=small,medium" + +const openFiltersTab = async (page: Page) => { + await page.locator("#content-settings-button").click() + await page.getByRole("tab").last().click() +} + for (const dir of languageDirections) { breakpoints.describeEachDesktop(() => { test(`Filters sidebar none selected - ${dir}`, async ({ page }) => { @@ -19,7 +27,7 @@ for (const dir of languageDirections) { ) }) - test(`Filters sidebar some filters selected - ${dir}`, async ({ page }) => { + test(`Filters sidebar 1 filter selected - ${dir}`, async ({ page }) => { await goToSearchTerm(page, "birds", { dir }) await page.locator('input[type="checkbox"]').first().check() @@ -32,20 +40,30 @@ for (const dir of languageDirections) { breakpoints.describeEachMobile(({ expectSnapshot }) => { test(`Filters modal none selected - ${dir}`, async ({ page }) => { await goToSearchTerm(page, "birds", { dir }) - await page.getByRole("button", { name: "Menu" }).click() - await page.getByRole("tab", { name: t("filters.title", dir) }).click() + await openFiltersTab(page) await expectSnapshot(`filters-modal-${dir}.png`, page) }) test(`Filters modal some filters selected - ${dir}`, async ({ page }) => { await goToSearchTerm(page, "birds", { dir }) - await page.getByRole("button", { name: "Menu" }).click() - await page.getByRole("tab", { name: t("filters.title", dir) }).click() + await openFiltersTab(page) await page.locator('input[type="checkbox"]').first().check() await expectSnapshot(`filters-modal-filters-selected-${dir}.png`, page) }) + + test(`Filters modal with two-digits count label - ${dir}`, async ({ + page, + }) => { + await page.goto(pathWithDir(filtersCheckedUrl, dir)) + await openFiltersTab(page) + + await expectSnapshot( + `filters-modal-two-digits-count-checked-${dir}.png`, + page + ) + }) }) } diff --git a/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-ltr-png-md-linux.png b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-ltr-png-md-linux.png new file mode 100644 index 0000000000..ca082fd85b Binary files /dev/null and b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-ltr-png-md-linux.png differ diff --git a/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-ltr-png-sm-linux.png b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-ltr-png-sm-linux.png new file mode 100644 index 0000000000..eff3f818d3 Binary files /dev/null and b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-ltr-png-sm-linux.png differ diff --git a/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-ltr-png-xs-linux.png b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-ltr-png-xs-linux.png new file mode 100644 index 0000000000..0e4185ce22 Binary files /dev/null and b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-ltr-png-xs-linux.png differ diff --git a/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-rtl-png-md-linux.png b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-rtl-png-md-linux.png new file mode 100644 index 0000000000..04db623f7b Binary files /dev/null and b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-rtl-png-md-linux.png differ diff --git a/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-rtl-png-sm-linux.png b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-rtl-png-sm-linux.png new file mode 100644 index 0000000000..b35a632056 Binary files /dev/null and b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-rtl-png-sm-linux.png differ diff --git a/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-rtl-png-xs-linux.png b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-rtl-png-xs-linux.png new file mode 100644 index 0000000000..c6d35c0de9 Binary files /dev/null and b/test/playwright/visual-regression/components/filters.spec.ts-snapshots/filters-modal-two-digits-count-checked-rtl-png-xs-linux.png differ diff --git a/test/tapes/search/audio/q=querywithnoresults&peaks=true_close.json5 b/test/tapes/search/audio/q=querywithnoresults&peaks=true_close.json5 new file mode 100644 index 0000000000..289766e317 --- /dev/null +++ b/test/tapes/search/audio/q=querywithnoresults&peaks=true_close.json5 @@ -0,0 +1,87 @@ +{ + meta: { + createdAt: '2023-02-17T14:43:58.409Z', + host: 'https://api.openverse.engineering', + resHumanReadable: true, + }, + req: { + headers: { + connection: 'close', + }, + url: '/v1/audio/?q=querywithnoresults&peaks=true', + method: 'GET', + body: '', + }, + res: { + status: 200, + headers: { + date: [ + 'Fri, 17 Feb 2023 14:44:00 GMT', + ], + 'content-type': [ + 'application/json', + ], + 'content-length': [ + '70', + ], + connection: [ + 'close', + ], + vary: [ + 'Accept, Authorization, Origin', + ], + allow: [ + 'GET, HEAD, OPTIONS', + ], + 'x-frame-options': [ + 'DENY', + ], + 'x-content-type-options': [ + 'nosniff', + ], + 'referrer-policy': [ + 'same-origin', + ], + 'cross-origin-opener-policy': [ + 'same-origin', + ], + 'x-request-id': [ + '7dcc6d31fb1944448351cc94c5dbab91', + ], + 'cache-control': [ + 'max-age=14400', + ], + 'cf-cache-status': [ + 'MISS', + ], + 'last-modified': [ + 'Fri, 17 Feb 2023 14:44:00 GMT', + ], + 'accept-ranges': [ + 'bytes', + ], + 'server-timing': [ + 'cf-q-config;dur=6.0000002122251e-06', + ], + 'strict-transport-security': [ + 'max-age=15552000; includeSubDomains; preload', + ], + server: [ + 'cloudflare', + ], + 'cf-ray': [ + '79af4c6948f6b9d5-OTP', + ], + 'alt-svc': [ + 'h3=":443"; ma=86400, h3-29=":443"; ma=86400', + ], + }, + body: { + result_count: 0, + page_count: 0, + page_size: 20, + page: 1, + results: [], + }, + }, +} \ No newline at end of file diff --git a/test/tapes/search/images/q=birds&category=photograph_close.json5 b/test/tapes/search/images/q=birds&category=photograph_close.json5 new file mode 100644 index 0000000000..4d79037b0a --- /dev/null +++ b/test/tapes/search/images/q=birds&category=photograph_close.json5 @@ -0,0 +1,786 @@ +{ + meta: { + createdAt: '2023-02-17T12:32:30.132Z', + host: 'https://api.openverse.engineering', + resHumanReadable: true, + }, + req: { + headers: { + connection: 'close', + }, + url: '/v1/images/?q=birds&category=photograph,illustration,digitized_artwork&extension=jpg,png,gif,svg&aspect_ratio=tall,wide,square&size=small,medium', + method: 'GET', + body: '', + }, + res: { + status: 200, + headers: { + date: [ + 'Fri, 17 Feb 2023 12:32:31 GMT', + ], + 'content-type': [ + 'application/json', + ], + 'transfer-encoding': [ + 'chunked', + ], + connection: [ + 'close', + ], + vary: [ + 'Accept-Encoding, Accept, Authorization, Origin', + ], + allow: [ + 'GET, HEAD, OPTIONS', + ], + 'x-frame-options': [ + 'DENY', + ], + 'x-content-type-options': [ + 'nosniff', + ], + 'referrer-policy': [ + 'same-origin', + ], + 'cross-origin-opener-policy': [ + 'same-origin', + ], + 'x-request-id': [ + 'd99ae3a16fcf47dab689e2a248516c00', + ], + 'cache-control': [ + 'max-age=14400', + ], + 'cf-cache-status': [ + 'MISS', + ], + 'last-modified': [ + 'Fri, 17 Feb 2023 12:32:31 GMT', + ], + 'server-timing': [ + 'cf-q-config;dur=6.0000002122251e-06', + ], + 'strict-transport-security': [ + 'max-age=15552000; includeSubDomains; preload', + ], + server: [ + 'cloudflare', + ], + 'cf-ray': [ + '79ae8bce29dd989d-OTP', + ], + 'alt-svc': [ + 'h3=":443"; ma=86400, h3-29=":443"; ma=86400', + ], + }, + body: { + result_count: 3714, + page_count: 20, + page_size: 20, + page: 1, + results: [ + { + id: 'f3a97fd8-8a31-4411-811e-c1cbc0129395', + title: 'Ba bird', + indexed_on: '2023-01-29T15:53:41.123882Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=3339878', + url: 'https://upload.wikimedia.org/wikipedia/commons/4/43/Ba_bird.svg', + creator: 'Jeff Dahl', + creator_url: 'https://commons.wikimedia.org/wiki/User:Jeff_Dahl', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 451498, + filetype: 'svg', + tags: [], + attribution: '"Ba bird" by Jeff Dahl is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 600, + width: 475, + thumbnail: 'http://localhost:49153/v1/images/f3a97fd8-8a31-4411-811e-c1cbc0129395/thumb/', + detail_url: 'http://localhost:49153/v1/images/f3a97fd8-8a31-4411-811e-c1cbc0129395/', + related_url: 'http://localhost:49153/v1/images/f3a97fd8-8a31-4411-811e-c1cbc0129395/related/', + }, + { + id: 'c0e066f6-a969-46a9-8951-2ab1db53512d', + title: "World Trade Center 9-11 Attacks Illustration with Bird's-eye Impact Locations", + indexed_on: '2020-02-20T16:00:57.405455Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=1744915', + url: 'https://upload.wikimedia.org/wikipedia/commons/d/d5/World_Trade_Center_9-11_Attacks_Illustration_with_Bird%27s-eye_Impact_Locations.svg', + creator: 'MesserWoland', + creator_url: 'https://commons.wikimedia.org/wiki/User:MesserWoland', + license: 'by-sa', + license_version: '3.0', + license_url: 'https://creativecommons.org/licenses/by-sa/3.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 293116, + filetype: 'svg', + tags: [], + attribution: '"World Trade Center 9-11 Attacks Illustration with Bird\'s-eye Impact Locations" by MesserWoland is licensed under CC BY-SA 3.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/3.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 950, + width: 880, + thumbnail: 'http://localhost:49153/v1/images/c0e066f6-a969-46a9-8951-2ab1db53512d/thumb/', + detail_url: 'http://localhost:49153/v1/images/c0e066f6-a969-46a9-8951-2ab1db53512d/', + related_url: 'http://localhost:49153/v1/images/c0e066f6-a969-46a9-8951-2ab1db53512d/related/', + }, + { + id: '57fce746-15e7-4184-9548-c41a59064c47', + title: 'Bennu bird', + indexed_on: '2023-01-22T16:41:03.857100Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=3293473', + url: 'https://upload.wikimedia.org/wikipedia/commons/0/03/Bennu_bird.svg', + creator: 'Jeff Dahl', + creator_url: 'https://commons.wikimedia.org/wiki/User:Jeff_Dahl', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 342151, + filetype: 'svg', + tags: [], + attribution: '"Bennu bird" by Jeff Dahl is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 650, + width: 425, + thumbnail: 'http://localhost:49153/v1/images/57fce746-15e7-4184-9548-c41a59064c47/thumb/', + detail_url: 'http://localhost:49153/v1/images/57fce746-15e7-4184-9548-c41a59064c47/', + related_url: 'http://localhost:49153/v1/images/57fce746-15e7-4184-9548-c41a59064c47/related/', + }, + { + id: 'e7d9570c-95b8-4d74-8f48-7a5bf9964750', + title: 'LaTeX project logo bird', + indexed_on: '2020-04-10T00:26:14.849044Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=89012582', + url: 'https://upload.wikimedia.org/wikipedia/commons/4/45/LaTeX_project_logo_bird.svg', + creator: 'Jonas Jared Jacek jonas.me', + creator_url: 'https://jonas.me', + license: 'by', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 31822, + filetype: 'svg', + tags: [], + attribution: '"LaTeX project logo bird" by Jonas Jared Jacek jonas.me is licensed under CC BY 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/4.0/.', + fields_matched: [ + 'title', + ], + mature: false, + height: 120, + width: 316, + thumbnail: 'http://localhost:49153/v1/images/e7d9570c-95b8-4d74-8f48-7a5bf9964750/thumb/', + detail_url: 'http://localhost:49153/v1/images/e7d9570c-95b8-4d74-8f48-7a5bf9964750/', + related_url: 'http://localhost:49153/v1/images/e7d9570c-95b8-4d74-8f48-7a5bf9964750/related/', + }, + { + id: 'b7cdba01-a151-49e4-a3e7-532a1438c1f3', + title: 'Size disparity of late Maastrichtian pterosaurs and birds', + indexed_on: '2022-06-13T00:24:03.946373Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=119224026', + url: 'https://upload.wikimedia.org/wikipedia/commons/3/30/Size_disparity_of_late_Maastrichtian_pterosaurs_and_birds.svg', + creator: 'Nicholas R. Longrich , David M. Martill, Brian Andres', + creator_url: null, + license: 'by', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 1798698, + filetype: 'svg', + tags: [], + attribution: '"Size disparity of late Maastrichtian pterosaurs and birds" by Nicholas R. Longrich , David M. Martill, Brian Andres is licensed under CC BY 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/4.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 386, + width: 512, + thumbnail: 'http://localhost:49153/v1/images/b7cdba01-a151-49e4-a3e7-532a1438c1f3/thumb/', + detail_url: 'http://localhost:49153/v1/images/b7cdba01-a151-49e4-a3e7-532a1438c1f3/', + related_url: 'http://localhost:49153/v1/images/b7cdba01-a151-49e4-a3e7-532a1438c1f3/related/', + }, + { + id: 'af3ff975-2ed6-4548-8148-494ef5e6cc0a', + title: 'Owner J A Bird', + indexed_on: '2022-10-09T10:16:55.161694Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=92014609', + url: 'https://upload.wikimedia.org/wikipedia/commons/a/a9/Owner_J_A_Bird.svg', + creator: 'JockeyColours', + creator_url: 'https://commons.wikimedia.org/w/index.php?title=User:JockeyColours&action=edit&redlink=1', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 16970, + filetype: 'svg', + tags: [], + attribution: '"Owner J A Bird" by JockeyColours is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'title', + ], + mature: false, + height: 791, + width: 512, + thumbnail: 'http://localhost:49153/v1/images/af3ff975-2ed6-4548-8148-494ef5e6cc0a/thumb/', + detail_url: 'http://localhost:49153/v1/images/af3ff975-2ed6-4548-8148-494ef5e6cc0a/', + related_url: 'http://localhost:49153/v1/images/af3ff975-2ed6-4548-8148-494ef5e6cc0a/related/', + }, + { + id: 'bf63bbb0-1286-4a00-a2b9-6ee9349f6c86', + title: 'The structure of bird eggs (hy)', + indexed_on: '2022-10-29T00:17:38.648209Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=124655510', + url: 'https://upload.wikimedia.org/wikipedia/commons/8/85/The_structure_of_bird_eggs_%28hy%29.svg', + creator: 'Gohar7', + creator_url: 'https://commons.wikimedia.org/w/index.php?title=User:Gohar7&action=edit&redlink=1', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 33215, + filetype: 'svg', + tags: [], + attribution: '"The structure of bird eggs (hy)" by Gohar7 is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 362, + width: 512, + thumbnail: 'http://localhost:49153/v1/images/bf63bbb0-1286-4a00-a2b9-6ee9349f6c86/thumb/', + detail_url: 'http://localhost:49153/v1/images/bf63bbb0-1286-4a00-a2b9-6ee9349f6c86/', + related_url: 'http://localhost:49153/v1/images/bf63bbb0-1286-4a00-a2b9-6ee9349f6c86/related/', + }, + { + id: '5697474b-9e7c-4a3b-b53c-e699718bf950', + title: 'Quantum Magnetoreception in Birds', + indexed_on: '2022-04-01T09:18:17.022262Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=116545906', + url: 'https://upload.wikimedia.org/wikipedia/commons/2/29/Quantum_Magnetoreception_in_Birds.svg', + creator: 'Chiswick Chap', + creator_url: 'https://commons.wikimedia.org/wiki/User:Chiswick_Chap', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 64395, + filetype: 'svg', + tags: [], + attribution: '"Quantum Magnetoreception in Birds" by Chiswick Chap is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 720, + width: 960, + thumbnail: 'http://localhost:49153/v1/images/5697474b-9e7c-4a3b-b53c-e699718bf950/thumb/', + detail_url: 'http://localhost:49153/v1/images/5697474b-9e7c-4a3b-b53c-e699718bf950/', + related_url: 'http://localhost:49153/v1/images/5697474b-9e7c-4a3b-b53c-e699718bf950/related/', + }, + { + id: '03f201d7-8f86-49b1-86ff-2a01a84162c4', + title: 'Bird no free image yet-he', + indexed_on: '2020-03-05T18:38:00.718167Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=56400136', + url: 'https://upload.wikimedia.org/wikipedia/commons/b/b0/Bird_no_free_image_yet-he.svg', + creator: 'קרלוס הגדול', + creator_url: 'https://commons.wikimedia.org/wiki/User:%D7%A7%D7%A8%D7%9C%D7%95%D7%A1_%D7%94%D7%92%D7%93%D7%95%D7%9C', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 38564, + filetype: 'svg', + tags: [], + attribution: '"Bird no free image yet-he" by קרלוס הגדול is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'title', + ], + mature: false, + height: 350, + width: 350, + thumbnail: 'http://localhost:49153/v1/images/03f201d7-8f86-49b1-86ff-2a01a84162c4/thumb/', + detail_url: 'http://localhost:49153/v1/images/03f201d7-8f86-49b1-86ff-2a01a84162c4/', + related_url: 'http://localhost:49153/v1/images/03f201d7-8f86-49b1-86ff-2a01a84162c4/related/', + }, + { + id: '56063377-459b-447b-9c9e-eb92ee8c631b', + title: 'Effect of RF interference on Magnetoreception in Birds', + indexed_on: '2022-04-01T09:18:17.022262Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=116548688', + url: 'https://upload.wikimedia.org/wikipedia/commons/6/62/Effect_of_RF_interference_on_Magnetoreception_in_Birds.svg', + creator: 'Chiswick Chap', + creator_url: 'https://commons.wikimedia.org/wiki/User:Chiswick_Chap', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 33162, + filetype: 'svg', + tags: [], + attribution: '"Effect of RF interference on Magnetoreception in Birds" by Chiswick Chap is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 624, + width: 680, + thumbnail: 'http://localhost:49153/v1/images/56063377-459b-447b-9c9e-eb92ee8c631b/thumb/', + detail_url: 'http://localhost:49153/v1/images/56063377-459b-447b-9c9e-eb92ee8c631b/', + related_url: 'http://localhost:49153/v1/images/56063377-459b-447b-9c9e-eb92ee8c631b/related/', + }, + { + id: '4c22cec2-6a7f-4afc-bc79-f0c4b5aeedce', + title: 'Bird range Calyptorhynchus funereus-2', + indexed_on: '2022-11-13T15:51:26.331040Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=9947619', + url: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bird_range_Calyptorhynchus_funereus-2.svg', + creator: 'Bird_range_Calyptorhynchus_funereus-2.png: *Bird_range_yellow-tailed_black_cockatoo.png: User Kiwifruitboi on en.wikipedia derivative work: Snowmanradio (talk) Australia_(orthographic_projection).svg: Ssolbergj AUS_locator_map.svg: Yarl Talk • PL derivative work: Addicted04 (talk)', + creator_url: 'https://commons.wikimedia.org/wiki/File:Bird_range_Calyptorhynchus_funereus-2.png', + license: 'by-sa', + license_version: '3.0', + license_url: 'https://creativecommons.org/licenses/by-sa/3.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 335624, + filetype: 'svg', + tags: [], + attribution: '"Bird range Calyptorhynchus funereus-2" by Bird_range_Calyptorhynchus_funereus-2.png: *Bird_range_yellow-tailed_black_cockatoo.png: User Kiwifruitboi on en.wikipedia derivative work: Snowmanradio (talk) Australia_(orthographic_projection).svg: Ssolbergj AUS_locator_map.svg: Yarl Talk • PL derivative work: Addicted04 (talk) is licensed under CC BY-SA 3.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/3.0/.', + fields_matched: [ + 'title', + ], + mature: false, + height: 250, + width: 300, + thumbnail: 'http://localhost:49153/v1/images/4c22cec2-6a7f-4afc-bc79-f0c4b5aeedce/thumb/', + detail_url: 'http://localhost:49153/v1/images/4c22cec2-6a7f-4afc-bc79-f0c4b5aeedce/', + related_url: 'http://localhost:49153/v1/images/4c22cec2-6a7f-4afc-bc79-f0c4b5aeedce/related/', + }, + { + id: 'b96b6c9e-32c0-4e7c-aa2e-65a048695deb', + title: 'Mishra bird contour', + indexed_on: '2022-11-13T08:39:29.795577Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=114942536', + url: 'https://upload.wikimedia.org/wikipedia/commons/3/30/Mishra_bird_contour.svg', + creator: 'Nschloe', + creator_url: 'https://commons.wikimedia.org/w/index.php?title=User:Nschloe&action=edit&redlink=1', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 101767, + filetype: 'svg', + tags: [], + attribution: '"Mishra bird contour" by Nschloe is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 420, + width: 509, + thumbnail: 'http://localhost:49153/v1/images/b96b6c9e-32c0-4e7c-aa2e-65a048695deb/thumb/', + detail_url: 'http://localhost:49153/v1/images/b96b6c9e-32c0-4e7c-aa2e-65a048695deb/', + related_url: 'http://localhost:49153/v1/images/b96b6c9e-32c0-4e7c-aa2e-65a048695deb/related/', + }, + { + id: '17f02fca-a351-42ee-9d6f-041fe568df3f', + title: 'Secretary bird holding a snake', + indexed_on: '2020-02-01T16:00:23.033716Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=86451905', + url: 'https://upload.wikimedia.org/wikipedia/commons/4/4c/Secretary_bird_holding_a_snake.svg', + creator: 'Loggail', + creator_url: null, + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 22697, + filetype: 'svg', + tags: [], + attribution: '"Secretary bird holding a snake" by Loggail is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 754, + width: 558, + thumbnail: 'http://localhost:49153/v1/images/17f02fca-a351-42ee-9d6f-041fe568df3f/thumb/', + detail_url: 'http://localhost:49153/v1/images/17f02fca-a351-42ee-9d6f-041fe568df3f/', + related_url: 'http://localhost:49153/v1/images/17f02fca-a351-42ee-9d6f-041fe568df3f/related/', + }, + { + id: 'a31c91fa-9ccc-4443-a45d-b25d3e8466c4', + title: 'Bird scan lemma 6789 svg', + indexed_on: '2020-02-18T00:05:11.786650Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=82679509', + url: 'https://upload.wikimedia.org/wikipedia/commons/6/63/Bird_scan_lemma_6789_svg.svg', + creator: 'Jochen Burghardt', + creator_url: 'https://commons.wikimedia.org/wiki/User:Jochen_Burghardt', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 32466, + filetype: 'svg', + tags: [], + attribution: '"Bird scan lemma 6789 svg" by Jochen Burghardt is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'title', + ], + mature: false, + height: 283, + width: 478, + thumbnail: 'http://localhost:49153/v1/images/a31c91fa-9ccc-4443-a45d-b25d3e8466c4/thumb/', + detail_url: 'http://localhost:49153/v1/images/a31c91fa-9ccc-4443-a45d-b25d3e8466c4/', + related_url: 'http://localhost:49153/v1/images/a31c91fa-9ccc-4443-a45d-b25d3e8466c4/related/', + }, + { + id: 'b39bea12-6f7f-4242-8505-c74f52d87870', + title: 'Birds on identical tiles edge-to-edge like puzzle pieces Non-periodic tiling', + indexed_on: '2022-09-09T06:34:58.294218Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=121448567', + url: 'https://upload.wikimedia.org/wikipedia/commons/8/8c/Birds_on_identical_tiles_edge-to-edge_like_puzzle_pieces_Non-periodic_tiling.svg', + creator: 'Arthur Baelde', + creator_url: 'https://commons.wikimedia.org/wiki/User:Arthur_Baelde', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 2111, + filetype: 'svg', + tags: [], + attribution: '"Birds on identical tiles edge-to-edge like puzzle pieces Non-periodic tiling" by Arthur Baelde is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'title', + ], + mature: false, + height: 600, + width: 600, + thumbnail: 'http://localhost:49153/v1/images/b39bea12-6f7f-4242-8505-c74f52d87870/thumb/', + detail_url: 'http://localhost:49153/v1/images/b39bea12-6f7f-4242-8505-c74f52d87870/', + related_url: 'http://localhost:49153/v1/images/b39bea12-6f7f-4242-8505-c74f52d87870/related/', + }, + { + id: '94a71f7f-3ef1-424d-a0a0-fbd02c73761e', + title: 'Bird fold scan fusion 6789 svg', + indexed_on: '2020-02-18T00:05:11.786650Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=82679519', + url: 'https://upload.wikimedia.org/wikipedia/commons/4/4f/Bird_fold_scan_fusion_6789_svg.svg', + creator: 'Jochen Burghardt', + creator_url: 'https://commons.wikimedia.org/wiki/User:Jochen_Burghardt', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 73293, + filetype: 'svg', + tags: [], + attribution: '"Bird fold scan fusion 6789 svg" by Jochen Burghardt is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'title', + ], + mature: false, + height: 283, + width: 886, + thumbnail: 'http://localhost:49153/v1/images/94a71f7f-3ef1-424d-a0a0-fbd02c73761e/thumb/', + detail_url: 'http://localhost:49153/v1/images/94a71f7f-3ef1-424d-a0a0-fbd02c73761e/', + related_url: 'http://localhost:49153/v1/images/94a71f7f-3ef1-424d-a0a0-fbd02c73761e/related/', + }, + { + id: 'f4543b4b-beeb-4865-8e57-1b39aaf179f3', + title: 'Stopper for a Lime Container in the Form of a Bird', + indexed_on: '2019-05-28T11:45:03.107587Z', + foreign_landing_url: 'https://www.brooklynmuseum.org/opencollection/objects/65573', + url: 'https://d1lfxha3ugu3d4.cloudfront.net/images/opencollection/objects/size4/CUR.51.197.1_print_side1_bw.jpg', + creator: 'Iatmul', + creator_url: null, + license: 'by', + license_version: '3.0', + license_url: 'https://creativecommons.org/licenses/by/3.0/', + provider: 'brooklynmuseum', + source: 'brooklynmuseum', + category: 'digitized_artwork', + filesize: null, + filetype: 'jpg', + tags: [ + { + name: 'wood', + accuracy: null, + }, + { + name: 'stopper', + accuracy: null, + }, + { + name: 'fiber', + accuracy: null, + }, + { + name: 'container', + accuracy: null, + }, + { + name: 'citrus', + accuracy: null, + }, + { + name: 'storage', + accuracy: null, + }, + { + name: 'pigment', + accuracy: null, + }, + { + name: 'Stopper for a lime container in the form of a bird', + accuracy: null, + }, + { + name: 'shell', + accuracy: null, + }, + { + name: 'clay', + accuracy: null, + }, + { + name: 'bird', + accuracy: null, + }, + { + name: '19th century', + accuracy: null, + }, + { + name: 'lime', + accuracy: null, + }, + ], + attribution: '"Stopper for a Lime Container in the Form of a Bird" by Iatmul is licensed under CC BY 3.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/3.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1536, + width: 650, + thumbnail: 'http://localhost:49153/v1/images/f4543b4b-beeb-4865-8e57-1b39aaf179f3/thumb/', + detail_url: 'http://localhost:49153/v1/images/f4543b4b-beeb-4865-8e57-1b39aaf179f3/', + related_url: 'http://localhost:49153/v1/images/f4543b4b-beeb-4865-8e57-1b39aaf179f3/related/', + }, + { + id: 'ba926089-555a-492e-9c6d-eb774beb7b00', + title: 'Relief of People Driving off Birds', + indexed_on: '2019-05-28T11:45:03.107587Z', + foreign_landing_url: 'https://www.brooklynmuseum.org/opencollection/objects/78059', + url: 'https://d1lfxha3ugu3d4.cloudfront.net/images/opencollection/objects/size4/60.197.3_negA_bw_IMLS.jpg', + creator: null, + creator_url: null, + license: 'by', + license_version: '3.0', + license_url: 'https://creativecommons.org/licenses/by/3.0/', + provider: 'brooklynmuseum', + source: 'brooklynmuseum', + category: 'digitized_artwork', + filesize: null, + filetype: 'jpg', + tags: [ + { + name: 'B.C.E.', + accuracy: null, + }, + { + name: 'Amarna', + accuracy: null, + }, + { + name: 'LImestone', + accuracy: null, + }, + { + name: 'off', + accuracy: null, + }, + { + name: 'Offering', + accuracy: null, + }, + { + name: 'Driving', + accuracy: null, + }, + { + name: 'Egyptian', + accuracy: null, + }, + { + name: 'Hermopolis', + accuracy: null, + }, + { + name: 'Tell el Amarna', + accuracy: null, + }, + { + name: '18th Dynasty', + accuracy: null, + }, + { + name: 'Scene', + accuracy: null, + }, + { + name: 'People', + accuracy: null, + }, + { + name: 'Egypt', + accuracy: null, + }, + { + name: 'Ancient', + accuracy: null, + }, + { + name: 'Relief', + accuracy: null, + }, + { + name: 'Magna', + accuracy: null, + }, + { + name: '1353-1336', + accuracy: null, + }, + { + name: 'Birds', + accuracy: null, + }, + ], + attribution: '"Relief of People Driving off Birds" is licensed under CC BY 3.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/3.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 716, + width: 1536, + thumbnail: 'http://localhost:49153/v1/images/ba926089-555a-492e-9c6d-eb774beb7b00/thumb/', + detail_url: 'http://localhost:49153/v1/images/ba926089-555a-492e-9c6d-eb774beb7b00/', + related_url: 'http://localhost:49153/v1/images/ba926089-555a-492e-9c6d-eb774beb7b00/related/', + }, + { + id: '206cf9ae-873b-4dbf-9589-ec87fdd1a8a1', + title: 'Bird Rides logo white', + indexed_on: '2020-02-12T08:00:40.608204Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=76039540', + url: 'https://upload.wikimedia.org/wikipedia/commons/4/41/Bird_Rides_logo_white.svg', + creator: 'Cam.wu', + creator_url: 'https://commons.wikimedia.org/w/index.php?title=User:Cam.wu&action=edit&redlink=1', + license: 'by-sa', + license_version: '4.0', + license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 866, + filetype: 'svg', + tags: [], + attribution: '"Bird Rides logo white" by Cam.wu is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 285, + width: 512, + thumbnail: 'http://localhost:49153/v1/images/206cf9ae-873b-4dbf-9589-ec87fdd1a8a1/thumb/', + detail_url: 'http://localhost:49153/v1/images/206cf9ae-873b-4dbf-9589-ec87fdd1a8a1/', + related_url: 'http://localhost:49153/v1/images/206cf9ae-873b-4dbf-9589-ec87fdd1a8a1/related/', + }, + { + id: '7eb8cc07-6374-4a7c-944d-7d0931784b3f', + title: 'Live bird', + indexed_on: '2022-10-01T00:17:01.795704Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=18575320', + url: 'https://upload.wikimedia.org/wikipedia/commons/3/3d/Live_bird.svg', + creator: 'Isarra', + creator_url: 'https://commons.wikimedia.org/wiki/User:Isarra', + license: 'by-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-sa/2.0/', + provider: 'wikimedia', + source: 'wikimedia', + category: 'illustration', + filesize: 237672, + filetype: 'svg', + tags: [], + attribution: '"Live bird" by Isarra is licensed under CC BY-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/2.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 1008, + width: 649, + thumbnail: 'http://localhost:49153/v1/images/7eb8cc07-6374-4a7c-944d-7d0931784b3f/thumb/', + detail_url: 'http://localhost:49153/v1/images/7eb8cc07-6374-4a7c-944d-7d0931784b3f/', + related_url: 'http://localhost:49153/v1/images/7eb8cc07-6374-4a7c-944d-7d0931784b3f/related/', + }, + ], + }, + }, +} \ No newline at end of file diff --git a/test/tapes/search/images/q=querywithnoresults_close.json5 b/test/tapes/search/images/q=querywithnoresults_close.json5 new file mode 100644 index 0000000000..d5c90507be --- /dev/null +++ b/test/tapes/search/images/q=querywithnoresults_close.json5 @@ -0,0 +1,87 @@ +{ + meta: { + createdAt: '2023-02-17T14:43:58.295Z', + host: 'https://api.openverse.engineering', + resHumanReadable: true, + }, + req: { + headers: { + connection: 'close', + }, + url: '/v1/images/?q=querywithnoresults', + method: 'GET', + body: '', + }, + res: { + status: 200, + headers: { + date: [ + 'Fri, 17 Feb 2023 14:44:00 GMT', + ], + 'content-type': [ + 'application/json', + ], + 'content-length': [ + '70', + ], + connection: [ + 'close', + ], + vary: [ + 'Accept, Authorization, Origin', + ], + allow: [ + 'GET, HEAD, OPTIONS', + ], + 'x-frame-options': [ + 'DENY', + ], + 'x-content-type-options': [ + 'nosniff', + ], + 'referrer-policy': [ + 'same-origin', + ], + 'cross-origin-opener-policy': [ + 'same-origin', + ], + 'x-request-id': [ + '6449dea1b65748e79569c724e8b8c497', + ], + 'cache-control': [ + 'max-age=14400', + ], + 'cf-cache-status': [ + 'MISS', + ], + 'last-modified': [ + 'Fri, 17 Feb 2023 14:44:00 GMT', + ], + 'accept-ranges': [ + 'bytes', + ], + 'server-timing': [ + 'cf-q-config;dur=3.9999995351536e-06', + ], + 'strict-transport-security': [ + 'max-age=15552000; includeSubDomains; preload', + ], + server: [ + 'cloudflare', + ], + 'cf-ray': [ + '79af4c694858623b-OTP', + ], + 'alt-svc': [ + 'h3=":443"; ma=86400, h3-29=":443"; ma=86400', + ], + }, + body: { + result_count: 0, + page_count: 0, + page_size: 20, + page: 1, + results: [], + }, + }, +} \ No newline at end of file