1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-08 13:21:56 +00:00

Merge pull request from overleaf/msm-fix-outline-chat-stories

Fixed Chat and Outline stories

GitOrigin-RevId: ff0b0d8c733e7f3fc9a355ecc81c628d15497059
This commit is contained in:
Eric Mc Sween 2021-01-21 07:22:28 -05:00 committed by Copybot
parent 4e40eee738
commit 94e65f16a8
3 changed files with 24 additions and 6 deletions
services/web/frontend/stories

View file

@ -7,11 +7,10 @@ import {
stubUIConfig,
stubMathJax
} from '../../test/frontend/features/chat/components/stubs'
import { setupContext } from './fixtures/context'
const ONE_MINUTE = 60 * 1000
window.project_id = '1234'
const user = {
id: 'fake_user',
first_name: 'mortimer',
@ -45,8 +44,9 @@ function generateMessages(count) {
stubUIConfig()
stubMathJax()
stubChatStore({ user })
setupContext()
export const Conversation = args => <ChatPane {...args} />
export const Conversation = args => <ChatPane {...args} chatIsOpen />
Conversation.parameters = {
setupMocks: () => {
fetchMock.restore()
@ -55,7 +55,7 @@ Conversation.parameters = {
}
}
export const NoMessages = args => <ChatPane {...args} />
export const NoMessages = args => <ChatPane {...args} chatIsOpen />
NoMessages.parameters = {
setupMocks: () => {
fetchMock.restore()
@ -63,7 +63,7 @@ NoMessages.parameters = {
}
}
export const Loading = args => <ChatPane {...args} />
export const Loading = args => <ChatPane {...args} chatIsOpen />
Loading.parameters = {
setupMocks: () => {
fetchMock.restore()

View file

@ -0,0 +1,17 @@
import sinon from 'sinon'
export function setupContext() {
window.project_id = '1234'
let $scope = {}
if (window._ide) {
$scope = { ...window._ide.$scope, project: {} }
}
window._ide = {
...window._ide,
$scope,
socket: {
on: sinon.stub(),
removeListener: sinon.stub()
}
}
}

View file

@ -2,8 +2,9 @@ import React from 'react'
import OutlinePane from '../js/features/outline/components/outline-pane'
import { ContextRoot } from '../js/shared/context/root-context'
import { setupContext } from './fixtures/context'
window.project_id = '1234'
setupContext()
export const Basic = args => <OutlinePane {...args} />
Basic.args = {