mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-01 23:52:26 -05:00
b350843b4e
Add required attributes for ContextRoot in stories GitOrigin-RevId: c0cabf4eb03785c6232abe417e34bd7916b97046
31 lines
639 B
JavaScript
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'
|
|
}
|