Shun Miyazawa 2 лет назад
Родитель
Сommit
f059725579

+ 10 - 5
apps/app/test/cypress/e2e/20-basic-features/20-basic-features--username-mention.cy.ts

@@ -27,9 +27,12 @@ context('Mention username in comment', () => {
   });
 
   it('Successfully mention username in comment', () => {
-    const username = '@adm';
+    const username = 'adm';
 
-    cy.appendTextToEditorUntilContains(username);
+    cy.intercept('GET', `/_api/v3/users/usernames?q=${username}&limit=20`).as('searchUsername');
+    cy.appendTextToEditorUntilContains('@' + username);
+    cy.wait('@searchUsername');
+    cy.get('.CodeMirror-hints').should('be.visible');
 
     cy.get('#comments-container').within(() => { cy.screenshot(`${ssPrefix}1-username-found`) });
     // Click on mentioned username
@@ -38,10 +41,12 @@ context('Mention username in comment', () => {
   });
 
   it('Username not found when mention username in comment', () => {
-    const username = '@user';
-
-    cy.appendTextToEditorUntilContains(username);
+    const username = 'user';
 
+    cy.intercept('GET', `/_api/v3/users/usernames?q=${username}&limit=20`).as('searchUsername');
+    cy.appendTextToEditorUntilContains('@' + username);
+    cy.wait('@searchUsername');
+    cy.get('.CodeMirror-hints').should('be.visible');
 
     cy.get('#comments-container').within(() => { cy.screenshot(`${ssPrefix}3-username-not-found`) });
     // Click on username not found hint