mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-28 08:14:25 +02:00
Fixes frontend tests by mocking gapi object
This commit is contained in:
parent
bb89956e9a
commit
371f111706
@ -35,6 +35,11 @@ describe('Login/Recover Widget', function () {
|
||||
let dispatch = stub();
|
||||
|
||||
function renderComponent(props = {session: {pending: false, failed: false}}) {
|
||||
window.gapi = {
|
||||
load() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
component = reRenderIntoDocument(
|
||||
<MainHomePageLoginWidget dispatch={dispatch} {...props}/>
|
||||
);
|
||||
@ -116,6 +121,11 @@ describe('Login/Recover Widget', function () {
|
||||
let dispatch = stub();
|
||||
|
||||
beforeEach(function () {
|
||||
window.gapi = {
|
||||
load() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
component = TestUtils.renderIntoDocument(
|
||||
<MainHomePageLoginWidget dispatch={dispatch} session={{pending: false, failed: false}} />
|
||||
);
|
||||
|
@ -68,7 +68,7 @@ class MainHomePageLoginWidget extends React.Component {
|
||||
}
|
||||
|
||||
renderGoogleButton() {
|
||||
gapi.load('auth2', () => {
|
||||
window.gapi.load('auth2', () => {
|
||||
gapi.auth2.init({client_id: '50174278643-gtvjdpm5rmkv75lf3jsp95iv77a2usgu.apps.googleusercontent.com'})
|
||||
gapi.signin2.render('google-oauth-id', {
|
||||
scope: 'email',
|
||||
|
Loading…
x
Reference in New Issue
Block a user