overleaf/services/web/frontend/stories/fixtures/context.js
Alasdair Smith 522a71b514 Merge pull request #3708 from overleaf/msm-fix-chat-stories
Fix chat stories

GitOrigin-RevId: 7a36d9649486c203ba9334a18e380a595014e646
2021-03-05 03:04:53 +00:00

27 lines
445 B
JavaScript

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: {},
$watch: () => {},
ui: {
chatOpen: true
}
}
}
window._ide = {
...window._ide,
$scope,
socket: {
on: sinon.stub(),
removeListener: sinon.stub()
}
}
}