overleaf/services/web/frontend/stories/fixtures/context.js
Jakob Ackermann b350843b4e Merge pull request #3957 from overleaf/ae-stories-context-root
Add required attributes for ContextRoot in stories

GitOrigin-RevId: c0cabf4eb03785c6232abe417e34bd7916b97046
2021-04-29 02:09:17 +00:00

31 lines
639 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,
pdfLayout: 'flat',
},
}
}
window._ide = {
...window._ide,
$scope,
socket: {
on: sinon.stub(),
removeListener: sinon.stub(),
},
}
window.ExposedSettings = window.ExposedSettings || {}
window.ExposedSettings.appName = 'Overleaf'
window.gitBridgePublicBaseUrl = 'https://git.stories.com'
}