mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
1fcf94c3b9
React shared context GitOrigin-RevId: ebc6fa90dd8c65ddf803fd457c99a30f0e8e3c9c
37 lines
752 B
JavaScript
37 lines
752 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._ide = { socket: { on: sinon.stub(), off: sinon.stub() } }
|
|
window.user = user
|
|
}
|
|
|
|
export function tearDownChatStore() {
|
|
delete window._ide
|
|
delete window.user
|
|
}
|