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

[server-pro] fix e2e tests

GitOrigin-RevId: 589d23baf8bc815328f21b140f2086e135d13736
This commit is contained in:
Jakob Ackermann 2024-08-29 16:39:47 +02:00 committed by Copybot
parent d655cb129a
commit aa45f778c0
5 changed files with 9 additions and 11 deletions

View file

@ -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')

View file

@ -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')

View file

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

View file

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

View file

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