Added extra test for output when request has no keys

refs https://github.com/TryGhost/Toolbox/issues/292

- Providing extra coverage so the outputs are clear
This commit is contained in:
Naz 2022-05-10 14:18:38 +08:00
parent b4445cf6e0
commit ef0de40228

View File

@ -2,6 +2,17 @@ const assert = require('assert');
const extractApiKey = require('../index');
describe('Extract API Key', function () {
it('returns nulls for a request without any key', function () {
const {key, type} = extractApiKey({
query: {
filter: 'status:active'
}
});
assert.equal(key, null);
assert.equal(type, null);
});
it('Extracts Content API key from the request', function () {
const {key, type} = extractApiKey({
query: {