diff --git a/test/e2e-server/__snapshots__/well-known.test.js.snap b/test/e2e-server/__snapshots__/well-known.test.js.snap new file mode 100644 index 0000000000..695ac4e019 --- /dev/null +++ b/test/e2e-server/__snapshots__/well-known.test.js.snap @@ -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, + "kty": "RSA", + "n": Any, + }, + ], +} +`; + +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", +} +`; diff --git a/test/e2e-server/well-known.test.js b/test/e2e-server/well-known.test.js new file mode 100644 index 0000000000..5863c38d0a --- /dev/null +++ b/test/e2e-server/well-known.test.js @@ -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 + }); + }); + }); +});