Created
November 7, 2018 14:30
-
-
Save whtswrng/439aa95381837475cefcba55d1aa9352 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('when user was successfully logged in', () => { | |
const externalResponseHeaders = { | |
'set-cookie': 'valid-cookie-from-external-endpoint', | |
}; | |
beforeEach(async () => { | |
simulateSucessfulLoginResponse(externalResponseHeaders); // implementation should not be relevant for this demonstration | |
await executeAction(); // implementation should not be relevant for this demonstration | |
}); | |
it('should send OK with correct headers', () => { | |
expect(response.status).toHaveBeenCalledWith(200); | |
expect(response.header).toHaveBeenCalledWith('set-cookie', externalResponseHeaders['set-cookie']); | |
expect(response.send).toHaveBeenCalledTimes(1); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment