overleaf/services/web/frontend/stories/fixtures/context.js
Miguel Serrano f9962fefe8 React git-bridge modal (#3869)
GitOrigin-RevId: 5b2609ed9ad7909a10cb08342053e955447688f5
2021-04-01 02:06:05 +00:00

29 lines
577 B
JavaScript

import sinon from 'sinon'
export function setupContext() {
window.project_id = '1234'
window.user = {
id: 'fake_user'
}
let $scope = {}
if (window._ide) {
$scope = {
...window._ide.$scope,
project: {},
$watch: () => {},
ui: {
chatOpen: true
}
}
}
window._ide = {
...window._ide,
$scope,
socket: {
on: sinon.stub(),
removeListener: sinon.stub()
}
}
window.ExposedSettings = window.ExposedSettings || {}
window.ExposedSettings.gitBridgePublicBaseUrl = 'https://git.stories.com'
}