Created
July 3, 2019 19:32
-
-
Save crisperpo/c30322452a897e34fb1585896ae432d5 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/qojapeg
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
<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> | |
<script id="jsbin-source-javascript" type="text/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> |
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