stubs.js 663 B

1234567891011121314151617181920212223242526272829303132333435
  1. import sinon from 'sinon'
  2. export function stubUIConfig() {
  3. window.uiConfig = {
  4. chatMessageBorderSaturation: '85%',
  5. chatMessageBorderLightness: '40%',
  6. chatMessageBgSaturation: '85%',
  7. chatMessageBgLightness: '40%'
  8. }
  9. }
  10. export function tearDownUIConfigStubs() {
  11. delete window.uiConfig
  12. }
  13. export function stubMathJax() {
  14. window.MathJax = {
  15. Hub: {
  16. Queue: sinon.stub(),
  17. config: { tex2jax: { inlineMath: [['$', '$']] } }
  18. }
  19. }
  20. }
  21. export function tearDownMathJaxStubs() {
  22. delete window.MathJax
  23. }
  24. export function stubChatStore({ user }) {
  25. window.user = user
  26. }
  27. export function tearDownChatStore() {
  28. delete window.user
  29. }