mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 01:51:58 -05:00
1c2314a854
Fix history mode not being restored with React Nav Toolbar GitOrigin-RevId: 0022153b24db015c6122f45ad7965830e0033540
33 lines
698 B
JavaScript
33 lines
698 B
JavaScript
import sinon from 'sinon'
|
|
|
|
export function setupContext() {
|
|
window.project_id = '1234'
|
|
window.user = {
|
|
id: 'fake_user',
|
|
allowedFreeTrial: true,
|
|
}
|
|
let $scope = {}
|
|
if (window._ide) {
|
|
$scope = {
|
|
...window._ide.$scope,
|
|
project: {},
|
|
$watch: () => {},
|
|
ui: {
|
|
chatOpen: true,
|
|
pdfLayout: 'flat',
|
|
},
|
|
toggleHistory: () => {},
|
|
}
|
|
}
|
|
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'
|
|
}
|