mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 12:49:33 -05:00
0aba0300d1
* 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
32 lines
634 B
JavaScript
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'
|
|
}
|