Conversation
auto link is included in original tiptap extension-link. We should keep the original behavior as much as possible. Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
| const linkElement = event.target.parentElement instanceof HTMLAnchorElement | ||
| ? event.target.parentElement | ||
| : event.target | ||
|
|
||
| const isLink = linkElement && linkElement instanceof HTMLAnchorElement | ||
|
|
||
| const htmlHref = linkElement?.href |
There was a problem hiding this comment.
I've changed this part of the original code to make it possible to run tests inside Cypress.
Originally we used editor.getAttributes('link') but it not works in cypress
When we interact natively/manually with the editor, the original events "bubble" from the span tag, but in cypress tests, the event comes from a tag, and this tag doesn't have attributes in the editor.
It makes the automated test impossible to work, because of this I've changed the code to use the native properties of the link.
|
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
|
||
| cy.get('@winOpen') | ||
| .should('have.been.calledOnce') | ||
| .should('have.been.calledWith', `/index.php/f/${id}`) |
There was a problem hiding this comment.
This fails if NC is accessible with a sub path as the call will be like /sub/path/index.php/f/${id}. Not a big deal but this test may fail in the future if we change how NC is deployed in the CI job.
We could either check that the target of @winOpen ends with /index.php/f/${id} or get the sub path and include it in the expected value.
|
/backport to stable24 |
|
The backport to stable24 failed. Please do this backport manually. |
|
@vinicius73 Mind to take care of the manual backport then? :) |
Summary
Auto-link is included in the original tiptap extension-link.
We should keep the original behavior as much as possible.