Created
July 3, 2019 19:31
-
-
Save crisperpo/792cf5feca7960f780e6d008d2832746 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/cenusod
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
describe('SSO UserVoice token', () => { | |
it('Gets token from endpoint and set up consent in local storage', done => { | |
const wrapper = shallow(<ConsentUserVoice />); | |
jest.spyOn(window.localStorage.__proto__, 'getItem'); | |
window.localStorage.__proto__.getItem = jest.fn(); | |
jest.spyOn(window.localStorage.__proto__, 'setItem'); | |
window.localStorage.__proto__.setItem = jest.fn(); | |
setTimeout(() => { | |
wrapper.update(); | |
expect(localStorage.setItem).toHaveBeenCalled(); | |
done(); | |
}); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
This file contains hidden or 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('SSO UserVoice token', () => { | |
it('Gets token from endpoint and set up consent in local storage', done => { | |
const wrapper = shallow(<ConsentUserVoice />); | |
jest.spyOn(window.localStorage.__proto__, 'getItem'); | |
window.localStorage.__proto__.getItem = jest.fn(); | |
jest.spyOn(window.localStorage.__proto__, 'setItem'); | |
window.localStorage.__proto__.setItem = jest.fn(); | |
setTimeout(() => { | |
wrapper.update(); | |
expect(localStorage.setItem).toHaveBeenCalled(); | |
done(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment