diff --git a/cypress/e2e/nodes/Mentions.spec.js b/cypress/e2e/nodes/Mentions.spec.js index f62d4a6866b..6737535c92a 100644 --- a/cypress/e2e/nodes/Mentions.spec.js +++ b/cypress/e2e/nodes/Mentions.spec.js @@ -72,8 +72,11 @@ describe('Test mentioning users', () => { return cy.wait(`@${autocompleteReauestAlias}`) .then(() => { + cy.intercept({ method: 'PUT', url: '**/mention' }).as('putMention') cy.get('.tippy-box .suggestion-list').contains(mention).click() cy.get('span.mention').contains(mention).should('be.visible') + cy.wait('@putMention') + .its('response.statusCode').should('eq', 200) }) }) diff --git a/src/components/Suggestion/Mention/suggestions.js b/src/components/Suggestion/Mention/suggestions.js index 8934d87f68d..a48a5ccd8d3 100644 --- a/src/components/Suggestion/Mention/suggestions.js +++ b/src/components/Suggestion/Mention/suggestions.js @@ -6,8 +6,9 @@ import createSuggestions from '../suggestions.js' const USERS_LIST_ENDPOINT_URL = generateUrl('apps/text/api/v1/users') const emitMention = ({ session, props }) => { - axios.put(generateUrl('apps/text/session/mention'), { - documentId: session.documentId, + const documentId = session.documentId + axios.put(generateUrl(`apps/text/session/${documentId}/mention`), { + documentId, sessionId: session.id, sessionToken: session.token, mention: props.id,