2017-04-13 12:17:41 -04:00
|
|
|
import RavenConfig from '~/raven/raven_config';
|
|
|
|
import index from '~/raven/index';
|
2017-04-04 09:58:45 -04:00
|
|
|
|
2017-04-13 12:17:41 -04:00
|
|
|
fdescribe('RavenConfig options', () => {
|
|
|
|
let sentryDsn;
|
|
|
|
let currentUserId;
|
|
|
|
let gitlabUrl;
|
|
|
|
let isProduction;
|
|
|
|
let indexReturnValue;
|
2017-04-04 09:58:45 -04:00
|
|
|
|
2017-04-13 12:17:41 -04:00
|
|
|
beforeEach(() => {
|
|
|
|
sentryDsn = 'sentryDsn';
|
|
|
|
currentUserId = 'currentUserId';
|
|
|
|
gitlabUrl = 'gitlabUrl';
|
|
|
|
isProduction = 'isProduction';
|
2017-04-04 09:58:45 -04:00
|
|
|
|
2017-04-13 12:17:41 -04:00
|
|
|
window.gon = {
|
|
|
|
sentry_dsn: sentryDsn,
|
|
|
|
current_user_id: currentUserId,
|
|
|
|
gitlab_url: gitlabUrl,
|
|
|
|
is_production: isProduction,
|
|
|
|
};
|
2017-04-04 09:58:45 -04:00
|
|
|
|
2017-04-13 12:17:41 -04:00
|
|
|
spyOn(RavenConfig.init, 'bind');
|
|
|
|
|
|
|
|
indexReturnValue = index();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should init with .sentryDsn, .currentUserId, .whitelistUrls and .isProduction', () => {
|
|
|
|
expect(RavenConfig.init.bind).toHaveBeenCalledWith(RavenConfig, {
|
|
|
|
sentryDsn,
|
|
|
|
currentUserId,
|
|
|
|
whitelistUrls: [gitlabUrl],
|
|
|
|
isProduction,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return RavenConfig', () => {
|
|
|
|
expect(indexReturnValue).toBe(RavenConfig);
|
|
|
|
});
|
2017-04-04 09:58:45 -04:00
|
|
|
});
|