mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
9b59c0813c
* Replaced `application-context` with `user-context` * deleted `user` initialization with `window.user` * fixed tests and storybook GitOrigin-RevId: 0ed4b9070d7c6d370fee2112f310c4bcfea519e7
34 lines
723 B
JavaScript
34 lines
723 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,
|
|
user: window.user,
|
|
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'
|
|
}
|