|
@@ -29,12 +29,13 @@ context('Mention username in comment', () => {
|
|
|
it('Successfully mention username in comment', () => {
|
|
it('Successfully mention username in comment', () => {
|
|
|
const username = 'adm';
|
|
const username = 'adm';
|
|
|
|
|
|
|
|
|
|
+ cy.get('.comment').should('have.text', '');
|
|
|
|
|
+
|
|
|
cy.intercept('GET', `/_api/v3/users/usernames?q=${username}&limit=20`).as('searchUsername');
|
|
cy.intercept('GET', `/_api/v3/users/usernames?q=${username}&limit=20`).as('searchUsername');
|
|
|
cy.get('.CodeMirror').type('@' + username);
|
|
cy.get('.CodeMirror').type('@' + username);
|
|
|
cy.wait('@searchUsername');
|
|
cy.wait('@searchUsername');
|
|
|
cy.get('.CodeMirror-hints').should('be.visible');
|
|
cy.get('.CodeMirror-hints').should('be.visible');
|
|
|
|
|
|
|
|
-
|
|
|
|
|
cy.get('#comments-container').within(() => { cy.screenshot(`${ssPrefix}1-username-found`) });
|
|
cy.get('#comments-container').within(() => { cy.screenshot(`${ssPrefix}1-username-found`) });
|
|
|
// Click on mentioned username
|
|
// Click on mentioned username
|
|
|
cy.get('.CodeMirror-hints > li').first().click();
|
|
cy.get('.CodeMirror-hints > li').first().click();
|
|
@@ -44,6 +45,8 @@ context('Mention username in comment', () => {
|
|
|
it('Username not found when mention username in comment', () => {
|
|
it('Username not found when mention username in comment', () => {
|
|
|
const username = 'user';
|
|
const username = 'user';
|
|
|
|
|
|
|
|
|
|
+ cy.get('.comment').should('have.text', '');
|
|
|
|
|
+
|
|
|
cy.intercept('GET', `/_api/v3/users/usernames?q=${username}&limit=20`).as('searchUsername');
|
|
cy.intercept('GET', `/_api/v3/users/usernames?q=${username}&limit=20`).as('searchUsername');
|
|
|
cy.get('.CodeMirror').type('@' + username);
|
|
cy.get('.CodeMirror').type('@' + username);
|
|
|
cy.wait('@searchUsername');
|
|
cy.wait('@searchUsername');
|