overleaf/services/web/frontend/stories/fixtures/context.js
Jakob Ackermann da641ba039 Merge pull request #3649 from overleaf/as-chat-test-cleanup
Chat test cleanup

GitOrigin-RevId: 4323d93f64f0e51efd2931acbc77fc9b43a216cd
2021-02-18 03:04:51 +00:00

20 lines
361 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: {} }
}
window._ide = {
...window._ide,
$scope,
socket: {
on: sinon.stub(),
removeListener: sinon.stub()
}
}
}