mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
Covered well-known endpoint with e2e test
refs https://github.com/TryGhost/Team/issues/1640 - There was no coverage. Now there is :)
This commit is contained in:
parent
a18469a3be
commit
fd8ce6a5bf
24
test/e2e-server/__snapshots__/well-known.test.js.snap
Normal file
24
test/e2e-server/__snapshots__/well-known.test.js.snap
Normal file
@ -0,0 +1,24 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`.well-known GET /jwks.json should return a JWKS 1: [body] 1`] = `
|
||||
Object {
|
||||
"keys": Array [
|
||||
Object {
|
||||
"e": "AQAB",
|
||||
"kid": Any<String>,
|
||||
"kty": "RSA",
|
||||
"n": Any<String>,
|
||||
},
|
||||
],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`.well-known GET /jwks.json should return a JWKS 2: [headers] 1`] = `
|
||||
Object {
|
||||
"content-length": "265",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
`;
|
27
test/e2e-server/well-known.test.js
Normal file
27
test/e2e-server/well-known.test.js
Normal file
@ -0,0 +1,27 @@
|
||||
const {agentProvider, matchers} = require('../utils/e2e-framework');
|
||||
const {anyString, anyEtag} = matchers;
|
||||
|
||||
describe('.well-known', function () {
|
||||
let agentGhostAPI;
|
||||
|
||||
before(async function () {
|
||||
agentGhostAPI = await agentProvider.getGhostAPIAgent();
|
||||
});
|
||||
|
||||
describe('GET /jwks.json', function () {
|
||||
it('should return a JWKS', async function () {
|
||||
await agentGhostAPI
|
||||
.get('/.well-known/jwks.json')
|
||||
.expectStatus(200)
|
||||
.matchBodySnapshot({
|
||||
keys: [{
|
||||
kid: anyString,
|
||||
n: anyString
|
||||
}]
|
||||
})
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyEtag
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user