mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-01 04:42:37 +00:00
Added publish-context tests (#4702)
GitOrigin-RevId: 0076c9ecba31c33c157149e9f0927aa062ad07b5
This commit is contained in:
parent
8945373715
commit
cc72382722
1 changed files with 13 additions and 2 deletions
|
@ -13,9 +13,14 @@ import { ProjectProvider } from '../../../frontend/js/shared/context/project-con
|
|||
import { SplitTestProvider } from '../../../frontend/js/shared/context/split-test-context'
|
||||
import { CompileProvider } from '../../../frontend/js/shared/context/compile-context'
|
||||
|
||||
// these constants can be imported in tests instead of
|
||||
// using magic strings
|
||||
export const PROJECT_ID = 'project123'
|
||||
export const PROJECT_NAME = 'project-name'
|
||||
|
||||
export function EditorProviders({
|
||||
user = { id: '123abd', email: 'testuser@example.com' },
|
||||
projectId = 'project123',
|
||||
projectId = PROJECT_ID,
|
||||
socket = {
|
||||
on: sinon.stub(),
|
||||
removeListener: sinon.stub(),
|
||||
|
@ -24,6 +29,7 @@ export function EditorProviders({
|
|||
clsiServerId = '1234',
|
||||
scope,
|
||||
children,
|
||||
rootFolder,
|
||||
}) {
|
||||
window.user = user || window.user
|
||||
window.gitBridgePublicBaseUrl = 'git.overleaf.test'
|
||||
|
@ -34,11 +40,15 @@ export function EditorProviders({
|
|||
user: window.user,
|
||||
project: {
|
||||
_id: window.project_id,
|
||||
name: 'project-name',
|
||||
name: PROJECT_NAME,
|
||||
owner: {
|
||||
_id: '124abd',
|
||||
email: 'owner@example.com',
|
||||
},
|
||||
rootDoc_id: '_root_doc_id',
|
||||
},
|
||||
rootFolder: rootFolder || {
|
||||
children: [],
|
||||
},
|
||||
ui: {
|
||||
chatOpen: true,
|
||||
|
@ -62,6 +72,7 @@ export function EditorProviders({
|
|||
|
||||
const editorManager = {
|
||||
getCurrentDocId: () => 'foo',
|
||||
getCurrentDocValue: () => {},
|
||||
openDoc: sinon.stub(),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue