Просмотр исходного кода

Import USER_ID and USER_EMAIL in ShareProjectModal test file from EditorProviders test mock

GitOrigin-RevId: e45bb0806cc4e0a4b315b8098da6e628c7f427d1
M Fahru 4 лет назад
Родитель
Сommit
b245617b61

+ 7 - 3
services/web/test/frontend/features/share-project-modal/components/share-project-modal.test.js

@@ -15,7 +15,11 @@ import {
   cleanUpContext,
 } from '../../../helpers/render-with-context'
 import * as locationModule from '../../../../../frontend/js/features/share-project-modal/utils/location'
-import { EditorProviders } from '../../../helpers/editor-providers'
+import {
+  EditorProviders,
+  USER_EMAIL,
+  USER_ID,
+} from '../../../helpers/editor-providers'
 
 describe('<ShareProjectModal/>', function () {
   const project = {
@@ -26,8 +30,8 @@ describe('<ShareProjectModal/>', function () {
       compileGroup: 'standard',
     },
     owner: {
-      _id: 'member_author',
-      email: 'project-owner@example.com',
+      _id: USER_ID,
+      email: USER_EMAIL,
     },
     members: [],
     invites: [],

+ 3 - 1
services/web/test/frontend/helpers/editor-providers.js

@@ -17,9 +17,11 @@ import { DetachCompileProvider } from '../../../frontend/js/shared/context/detac
 // using magic strings
 export const PROJECT_ID = 'project123'
 export const PROJECT_NAME = 'project-name'
+export const USER_ID = '123abd'
+export const USER_EMAIL = 'testuser@example.com'
 
 export function EditorProviders({
-  user = { id: '123abd', email: 'testuser@example.com' },
+  user = { id: USER_ID, email: USER_EMAIL },
   projectId = PROJECT_ID,
   rootDocId = '_root_doc_id',
   socket = {