overleaf/services/web/frontend/stories/fixtures/context.js

21 lines
361 B
JavaScript
Raw Normal View History

import sinon from 'sinon'
export function setupContext() {
window.project_id = '1234'
window.user = {
id: 'fake_user'
}
let $scope = {}
if (window._ide) {
$scope = { ...window._ide.$scope, project: {} }
}
window._ide = {
...window._ide,
$scope,
socket: {
on: sinon.stub(),
removeListener: sinon.stub()
}
}
}