overleaf/services/web/frontend/stories/fixtures/context.js
Hugh O'Brien 0aba0300d1 GitHub sync modal react port (#3711)
* GH-sync React - initial left menu github sync react skeleton

* GH-sync modal main switching logic setup and free trial mode

* GH-sync react - message for link sharing users

* GH-sync react: link gh account from modal

* GH-sync React: add export to github form modal

* GH-sync react: display commits and merge buttons

* GH-sync react: merge logic

* GH-sync React: merge endpoint error handling

* GH-sync React: update error handling to new fetch behaviour

* GH-sync React: handle ignoring external updates

* GH-sync React: main switcher modal tests

* GH-sync React: tests for export and merge

* GH-sync react: error handling and error boundary

* GH-sync React: put behind alpha flag

* GH-sync React: re-adding translations lost in rebase and cleanup

* GH-sync React: use renderWithEditorContext for tests and replace missing translations

* GH-sync React review code cleanup
GH-sync React fix state ordering causing errors

GitOrigin-RevId: 37261966683112b399ef180ec6bc4036bc689fd9
2021-04-07 02:05:06 +00:00

32 lines
634 B
JavaScript

import sinon from 'sinon'
export function setupContext() {
window.project_id = '1234'
window.user = {
id: 'fake_user'
}
window.ExposedSettings = {
appName: 'Overleaf'
}
let $scope = {}
if (window._ide) {
$scope = {
...window._ide.$scope,
project: {},
$watch: () => {},
ui: {
chatOpen: true
}
}
}
window._ide = {
...window._ide,
$scope,
socket: {
on: sinon.stub(),
removeListener: sinon.stub()
}
}
window.ExposedSettings = window.ExposedSettings || {}
window.ExposedSettings.gitBridgePublicBaseUrl = 'https://git.stories.com'
}