Commit 6a38ae31 authored by Robert Knight's avatar Robert Knight

Add test for handling of non-object responses from auth window

parent 0f220f6e
......@@ -289,5 +289,21 @@ describe('sidebar/util/oauth-client', () => {
assert.equal(code, 'second-code');
});
});
it('ignores responses with non-object values', () => {
const authorized = authorize();
fakeWindow.sendMessage('not-an-object');
fakeWindow.sendMessage({
type: 'authorization_response',
code: 'second-code',
state: 'notrandom',
});
return authorized.then(code => {
assert.equal(code, 'second-code');
});
});
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment