diff --git a/cypress/e2e/nodes/Links.spec.js b/cypress/e2e/nodes/Links.spec.js index 43636f75a16..a33cd1a2dbc 100644 --- a/cypress/e2e/nodes/Links.spec.js +++ b/cypress/e2e/nodes/Links.spec.js @@ -20,25 +20,20 @@ describe('test link marks', function() { cy.openFile(fileName, { force: true }) }) - describe('link preview', function() { - it('shows a link preview', () => { + describe('link bubble', function() { + it('shows a link preview in the bubble', () => { cy.getContent().type('https://nextcloud.com') cy.getContent().type('{enter}') cy.getContent() + .find('a[href*="https://nextcloud.com"]') + .click() + + cy.get('.link-view-bubble') .find('.widgets--list', { timeout: 10000 }) .find('.widget-default--name') .contains('Nextcloud') }) - - it('does not show a link preview for links within a paragraph', () => { - cy.getContent().type('Please visit https://nextcloud.com') - cy.getContent().type('{enter}') - - cy.getContent() - .find('.widgets--list', { timeout: 10000 }) - .should('not.exist') - }) }) describe('autolink', function() { @@ -56,6 +51,11 @@ describe('test link marks', function() { .find(`a[href*="${Cypress.env('baseUrl')}"]`) .click({ force: true }) + cy.get('.link-view-bubble') + .find('.widget--list', { timeout: 10000 }) + .find('.widget-file--details') + .click() + cy.get('@winOpen') .should('have.been.calledOnce') .should('have.been.calledWithMatch', new RegExp(`/f/${id}$`)) @@ -76,6 +76,11 @@ describe('test link marks', function() { .find(`a[href*="${Cypress.env('baseUrl')}"]`) .click({ force: true }) + cy.get('.link-view-bubble') + .find('.widget--list', { timeout: 10000 }) + .find('.widget-file--details') + .click() + cy.get('@winOpen') .should('have.been.calledOnce') .should('have.been.calledWithMatch', new RegExp(`${Cypress.env('baseUrl')}/file-name\\?fileId=${id}$`)) @@ -116,6 +121,11 @@ describe('test link marks', function() { .should('have.text', text) // ensure correct text used .click({ force: true }) + cy.get('.link-view-bubble') + .find('.widget--list', { timeout: 10000 }) + .find('.widget-default--name') + .click() + cy.get('@winOpen') .should('have.been.calledOnce') .should('have.been.calledWith', url) @@ -148,10 +158,15 @@ describe('test link marks', function() { cy.contains('button', isFolder ? 'Choose' : `Choose ${filename}`).click() }) - return cy.getContent() + cy.getContent() .find(`a[href*="${encodeURIComponent(filename)}"]`) .should('have.text', text === undefined ? filename : text) .click({ force: true }) + + return cy.get('.link-view-bubble') + .find('.widget--list', { timeout: 10000 }) + .find('.widget-file--details') + .click() } beforeEach(() => cy.clearContent())