Fixes around URL tooltips and in-app matrix.to link handling (#9139)
* Add regression test for tooltipify exposing raw HTML * Handle m.to links involving children better * Comments * Fix mistaken assertion
This commit is contained in:
parent
48ae16b5a5
commit
e63072e21f
4 changed files with 37 additions and 19 deletions
|
@ -57,4 +57,19 @@ describe('tooltipify', () => {
|
|||
expect(containers).toHaveLength(0);
|
||||
expect(root.outerHTML).toEqual(originalHtml);
|
||||
});
|
||||
|
||||
it("does not re-wrap if called multiple times", () => {
|
||||
const component = mount(<div><a href="/foo">click</a></div>);
|
||||
const root = component.getDOMNode();
|
||||
const containers: Element[] = [];
|
||||
tooltipifyLinks([root], [], containers);
|
||||
tooltipifyLinks([root], [], containers);
|
||||
tooltipifyLinks([root], [], containers);
|
||||
tooltipifyLinks([root], [], containers);
|
||||
expect(containers).toHaveLength(1);
|
||||
const anchor = root.querySelector("a");
|
||||
expect(anchor?.getAttribute("href")).toEqual("/foo");
|
||||
const tooltip = anchor.querySelector(".mx_TextWithTooltip_target");
|
||||
expect(tooltip).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue