Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Refs: #2186, 6d8459b
  • Loading branch information
erkannt committed Jan 17, 2025
1 parent 3d3b9d0 commit 23939fc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/ghost.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('getPage', () => {
fetch: fetchMock
.sandbox()
.getOnce(
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}`, query: { key } },
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}/`, query: { key } },
{ body: { pages: [{ html: html.toString() }] } },
),
ghostApi: { key: Redacted.make(key) },
Expand All @@ -33,7 +33,7 @@ describe('getPage', () => {
])('when the page contains links', async (id, key) => {
const actual = await _.getPage(id)({
fetch: fetchMock.sandbox().getOnce(
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}`, query: { key } },
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}/`, query: { key } },
{
body: {
pages: [
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('getPage', () => {
])('when the page contains an image', async (id, key) => {
const actual = await _.getPage(id)({
fetch: fetchMock.sandbox().getOnce(
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}`, query: { key } },
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}/`, query: { key } },
{
body: {
pages: [
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('getPage', () => {
])('when the page contains a button', async (id, key) => {
const actual = await _.getPage(id)({
fetch: fetchMock.sandbox().getOnce(
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}`, query: { key } },
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}/`, query: { key } },
{
body: {
pages: [
Expand All @@ -114,7 +114,7 @@ describe('getPage', () => {
])('when the page contains a heading with an ID', async (id, key) => {
const actual = await _.getPage(id)({
fetch: fetchMock.sandbox().getOnce(
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}`, query: { key } },
{ url: `https://content.prereview.org/ghost/api/content/pages/${id}/`, query: { key } },
{
body: {
pages: [
Expand All @@ -138,7 +138,7 @@ describe('getPage', () => {
])('when the response cannot be decoded', async (id, key, response) => {
const fetch = fetchMock
.sandbox()
.getOnce({ url: `begin:https://content.prereview.org/ghost/api/content/pages/${id}?`, query: { key } }, response)
.getOnce({ url: `begin:https://content.prereview.org/ghost/api/content/pages/${id}/?`, query: { key } }, response)

const actual = await _.getPage(id)({
fetch,
Expand All @@ -155,7 +155,7 @@ describe('getPage', () => {
])('when the response has a 404 status code', async (id, key) => {
const fetch = fetchMock
.sandbox()
.getOnce({ url: `https://content.prereview.org/ghost/api/content/pages/${id}`, query: { key } }, Status.NotFound)
.getOnce({ url: `https://content.prereview.org/ghost/api/content/pages/${id}/`, query: { key } }, Status.NotFound)

const actual = await _.getPage(id)({
fetch,
Expand All @@ -172,7 +172,7 @@ describe('getPage', () => {
])('when the response has a non-200/404 status code', async (id, key, status) => {
const fetch = fetchMock
.sandbox()
.getOnce({ url: `begin:https://content.prereview.org/ghost/api/content/pages/${id}?`, query: { key } }, status)
.getOnce({ url: `begin:https://content.prereview.org/ghost/api/content/pages/${id}/?`, query: { key } }, status)

const actual = await _.getPage(id)({
fetch,
Expand Down

0 comments on commit 23939fc

Please sign in to comment.