mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-03 23:37:51 -05:00
df37668180
React chat tests GitOrigin-RevId: e3b4d5b7cb2657d9aad7e1006c18db4e6c0d8a3f
35 lines
665 B
JavaScript
35 lines
665 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 stubGlobalUser(user) {
|
|
window.user = user
|
|
}
|
|
|
|
export function tearDownGlobalUserStub() {
|
|
delete window.user
|
|
}
|