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:
parent
b4445cf6e0
commit
ef0de40228
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user