mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #3588 from overleaf/msm-fix-outline-chat-stories
Fixed Chat and Outline stories GitOrigin-RevId: ff0b0d8c733e7f3fc9a355ecc81c628d15497059
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user