RTE plain text mentions as pills (#10852)
* insert mentions as links styled as pills * post merge fix and update test * update comments, move typeguard out * create a text node instead of setting innerText * update test * update test * fix broken cypress test, remove .only * make it able to deal with inserting in middle of blank lines * update comment * fix strict null error * use typeguard * avoid implicit truth check * add hook tests * add comment * Update test/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners-test.tsx Co-authored-by: Andy Balaam <andy.balaam@matrix.org> --------- Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
This commit is contained in:
parent
acdbae3e8c
commit
0d981326ac
6 changed files with 146 additions and 40 deletions
|
@ -225,9 +225,10 @@ describe("Composer", () => {
|
|||
});
|
||||
// ...inserts the username into the composer
|
||||
cy.findByRole("textbox").within(() => {
|
||||
// TODO update this test when the mentions are inserted as pills, instead
|
||||
// of as text
|
||||
cy.findByText(otherUserName, { exact: false }).should("exist");
|
||||
cy.findByText(otherUserName, { exact: false })
|
||||
.should("exist")
|
||||
.should("have.attr", "contenteditable", "false")
|
||||
.should("have.attr", "data-mention-type", "user");
|
||||
});
|
||||
|
||||
// Send the message to clear the composer
|
||||
|
@ -250,9 +251,10 @@ describe("Composer", () => {
|
|||
// Selecting the autocomplete option using Enter inserts it into the composer
|
||||
cy.findByRole("textbox").type(`{Enter}`);
|
||||
cy.findByRole("textbox").within(() => {
|
||||
// TODO update this test when the mentions are inserted as pills, instead
|
||||
// of as text
|
||||
cy.findByText(otherUserName, { exact: false }).should("exist");
|
||||
cy.findByText(otherUserName, { exact: false })
|
||||
.should("exist")
|
||||
.should("have.attr", "contenteditable", "false")
|
||||
.should("have.attr", "data-mention-type", "user");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue