2021-01-21 07:22:28 -05:00
|
|
|
import sinon from 'sinon'
|
|
|
|
|
|
|
|
export function setupContext() {
|
|
|
|
window.project_id = '1234'
|
2021-02-17 05:05:33 -05:00
|
|
|
window.user = {
|
2021-04-27 03:52:58 -04:00
|
|
|
id: 'fake_user',
|
2021-02-17 05:05:33 -05:00
|
|
|
}
|
2021-01-21 07:22:28 -05:00
|
|
|
let $scope = {}
|
|
|
|
if (window._ide) {
|
2021-03-04 09:22:58 -05:00
|
|
|
$scope = {
|
|
|
|
...window._ide.$scope,
|
|
|
|
project: {},
|
|
|
|
$watch: () => {},
|
|
|
|
ui: {
|
2021-04-27 03:52:58 -04:00
|
|
|
chatOpen: true,
|
2021-04-28 04:46:39 -04:00
|
|
|
pdfLayout: 'flat',
|
2021-04-27 03:52:58 -04:00
|
|
|
},
|
2021-03-04 09:22:58 -05:00
|
|
|
}
|
2021-01-21 07:22:28 -05:00
|
|
|
}
|
|
|
|
window._ide = {
|
|
|
|
...window._ide,
|
|
|
|
$scope,
|
|
|
|
socket: {
|
|
|
|
on: sinon.stub(),
|
2021-04-27 03:52:58 -04:00
|
|
|
removeListener: sinon.stub(),
|
|
|
|
},
|
2021-01-21 07:22:28 -05:00
|
|
|
}
|
2021-03-31 11:46:43 -04:00
|
|
|
window.ExposedSettings = window.ExposedSettings || {}
|
2021-04-28 04:46:39 -04:00
|
|
|
window.ExposedSettings.appName = 'Overleaf'
|
|
|
|
window.gitBridgePublicBaseUrl = 'https://git.stories.com'
|
2021-01-21 07:22:28 -05:00
|
|
|
}
|