Added missing snapshots

refs eee8f364de

- Part of the snapshot file was not commited with a referenced commit
- Also while at it, had another look at naming used and have cleared up couple places
This commit is contained in:
Naz 2022-04-12 17:03:16 +08:00
parent 2db746e559
commit 3381dae1e6
2 changed files with 140 additions and 2 deletions

View File

@ -1,5 +1,143 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`API Versioning Admin API responds with current content version header when requested version is AHEAD and CAN respond 1: [body] 1`] = `
Object {
"site": Object {
"accent_color": "#FF1A75",
"description": "Thoughts, stories and ideas",
"icon": null,
"logo": null,
"title": "Ghost",
"url": "http://127.0.0.1:2369/",
"version": StringMatching /\\\\d\\+\\\\\\.\\\\d\\+/,
},
}
`;
exports[`API Versioning Admin API responds with current content version header when requested version is AHEAD and CAN respond 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "167",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Admin API responds with current content version header when requested version is BEHIND current version and CAN respond 1: [body] 1`] = `
Object {
"site": Object {
"accent_color": "#FF1A75",
"description": "Thoughts, stories and ideas",
"icon": null,
"logo": null,
"title": "Ghost",
"url": "http://127.0.0.1:2369/",
"version": StringMatching /\\\\d\\+\\\\\\.\\\\d\\+/,
},
}
`;
exports[`API Versioning Admin API responds with current content version header when requested version is BEHIND current version and CAN respond 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "167",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Admin API responds with error requested version is AHEAD and CANNOT respond 1: [body] 1`] = `
Object {
"errors": Array [
Object {
"code": null,
"context": "Provided client version v999.1 is ahead of current Ghost instance version v4.43.",
"details": null,
"help": "Upgrade your Ghost instance.",
"id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/,
"message": "Request not acceptable for provided Accept-Version header.",
"property": null,
"type": "RequestNotAcceptableError",
},
],
}
`;
exports[`API Versioning Admin API responds with error requested version is AHEAD and CANNOT respond 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "338",
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Admin API responds with error when requested version is BEHIND and CANNOT respond 1: [body] 1`] = `
Object {
"errors": Array [
Object {
"code": null,
"context": "Provided client version v3.1 is outdated and is behind current Ghost version v4.43.",
"details": null,
"help": "Upgrade your Ghost API client.",
"id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/,
"message": "Request not acceptable for provided Accept-Version header.",
"property": null,
"type": "RequestNotAcceptableError",
},
],
}
`;
exports[`API Versioning Admin API responds with error when requested version is BEHIND and CANNOT respond 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "343",
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Admin API responds with no content version header when accept version header is NOT PRESENT 1: [body] 1`] = `
Object {
"site": Object {
"accent_color": "#FF1A75",
"description": "Thoughts, stories and ideas",
"icon": null,
"logo": null,
"title": "Ghost",
"url": "http://127.0.0.1:2369/",
"version": StringMatching /\\\\d\\+\\\\\\.\\\\d\\+/,
},
}
`;
exports[`API Versioning Admin API responds with no content version header when accept version header is NOT PRESENT 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "167",
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Content API responds with current content version header when requested version is BEHIND current version and CAN respond 1: [body] 1`] = `
Object {
"meta": Object {},

View File

@ -52,7 +52,7 @@ describe('API Versioning', function () {
});
});
it('responds with error current content version header when requested version is AHEAD and CANNOT respond', async function () {
it('responds with error requested version is AHEAD and CANNOT respond', async function () {
// CASE 2: If accept-version is behind, send a 406 & tell them the client needs updating.
await agentAdminAPI
.get('removed_endpoint')
@ -67,7 +67,7 @@ describe('API Versioning', function () {
});
});
it('responds with error current content version header when requested version is BEHIND and CANNOT respond', async function () {
it('responds with error when requested version is BEHIND and CANNOT respond', async function () {
// CASE 2: If accept-version is behind, send a 406 & tell them the client needs updating.
await agentAdminAPI
.get('removed_endpoint')