overleaf/services/web/test/frontend/features/chat/components/stubs.js
Paulo Jorge Reis 11e58b5844 Add timeout upgrade prompt to the new compile UI (#3528)
* Uncouple account-upgrade and exposted-settings from Angular

* Mock socket shim with the correct methods

* Extract timeout upgrade prompt to a component

GitOrigin-RevId: ee8058b38bf5e20924a21f40d32c5bb0ee06c555
2021-01-15 03:05:48 +00:00

35 lines
663 B
JavaScript

import sinon from 'sinon'
export function stubUIConfig() {
window.uiConfig = {
chatMessageBorderSaturation: '85%',
chatMessageBorderLightness: '40%',
chatMessageBgSaturation: '85%',
chatMessageBgLightness: '40%'
}
}
export function tearDownUIConfigStubs() {
delete window.uiConfig
}
export function stubMathJax() {
window.MathJax = {
Hub: {
Queue: sinon.stub(),
config: { tex2jax: { inlineMath: [['$', '$']] } }
}
}
}
export function tearDownMathJaxStubs() {
delete window.MathJax
}
export function stubChatStore({ user }) {
window.user = user
}
export function tearDownChatStore() {
delete window.user
}