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