Parcourir la source

Merge pull request #20137 from overleaf/jpa-fix-e2e

[server-pro] fix e2e tests

GitOrigin-RevId: 589d23baf8bc815328f21b140f2086e135d13736
Jakob Ackermann il y a 1 an
Parent
commit
aa45f778c0

+ 5 - 6
server-ce/test/admin.spec.ts

@@ -258,8 +258,7 @@ describe('admin panel', function () {
       })
     })
 
-    // eslint-disable-next-line mocha/no-skipped-tests
-    it.skip('restore deleted projects', () => {
+    it('restore deleted projects', () => {
       login(user1)
       cy.visit('/project')
 
@@ -270,7 +269,7 @@ describe('admin panel', function () {
 
       cy.log('delete project')
       findProjectRow(deletedProjectName).within(() =>
-        cy.contains('Trash').click()
+        cy.findByRole('button', { name: 'Trash' }).click()
       )
       cy.get('button').contains('Confirm').click()
       cy.findByText(deletedProjectName).should('not.exist')
@@ -280,7 +279,7 @@ describe('admin panel', function () {
         cy.findByText('Trashed Projects').click()
       })
       findProjectRow(deletedProjectName).within(() =>
-        cy.contains('Delete').click()
+        cy.findByRole('button', { name: 'Delete' }).click()
       )
       cy.get('button').contains('Confirm').click()
       cy.findByText(deletedProjectName).should('not.exist')
@@ -294,8 +293,8 @@ describe('admin panel', function () {
       cy.get('a').contains(deletedProjectName).click()
 
       cy.log('undelete the project')
-      cy.findByText('undelete').click()
-      cy.findByText('undelete').should('not.exist')
+      cy.findByText('Undelete').click()
+      cy.findByText('Undelete').should('not.exist')
       cy.url().should('contain', `/admin/project/${projectToDeleteId}`)
 
       cy.log('login as the user and verify the project is restored')

+ 1 - 2
server-ce/test/project-sharing.spec.ts

@@ -296,8 +296,7 @@ describe('Project Sharing', function () {
           expectRestrictedReadOnlyAccess()
         })
 
-        // eslint-disable-next-line mocha/no-skipped-tests
-        it.skip('should grant write access with write link', () => {
+        it('should grant write access with write link', () => {
           cy.visit(linkSharingReadAndWrite)
           expectReadAndWriteAccess()
           expectEditAuthoredAs('Anonymous')

+ 1 - 1
services/web/frontend/js/features/chat/components/chat-pane.tsx

@@ -62,7 +62,7 @@ const ChatPane = React.memo(function ChatPane() {
     throw error
   }
 
-  if (!user?.id) {
+  if (!user) {
     return null
   }
   if (!chatOpenedOnce) {

+ 1 - 1
services/web/frontend/js/features/chat/components/message-list.jsx

@@ -61,7 +61,7 @@ MessageList.propTypes = {
     })
   ).isRequired,
   resetUnreadMessages: PropTypes.func.isRequired,
-  userId: PropTypes.string.isRequired,
+  userId: PropTypes.string,
 }
 
 export default MessageList

+ 1 - 1
services/web/frontend/js/features/chat/components/message.jsx

@@ -52,7 +52,7 @@ Message.propTypes = {
       first_name: PropTypes.string,
     }),
   }),
-  userId: PropTypes.string.isRequired,
+  userId: PropTypes.string,
 }
 
 export default Message