Skip to content

Commit a2abe68

Browse files
author
Jack Pope
committed
Fix dangerouslySetInnterHTML-test
1 parent d694e15 commit a2abe68

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

packages/react-dom/src/client/__tests__/dangerouslySetInnerHTML-test.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -58,40 +58,5 @@ describe('dangerouslySetInnerHTML', () => {
5858
innerHTMLDescriptor,
5959
);
6060
});
61-
62-
it('sets innerHTML on it', async () => {
63-
const html = '<circle></circle>';
64-
const container = document.createElementNS(
65-
'http://www.w3.org/2000/svg',
66-
'svg',
67-
);
68-
const root = ReactDOMClient.createRoot(container);
69-
await act(() => {
70-
root.render(<g dangerouslySetInnerHTML={{__html: html}} />);
71-
});
72-
const circle = container.firstChild.firstChild;
73-
expect(circle.tagName).toBe('circle');
74-
});
75-
76-
it('clears previous children', async () => {
77-
const firstHtml = '<rect></rect>';
78-
const secondHtml = '<circle></circle>';
79-
80-
const container = document.createElementNS(
81-
'http://www.w3.org/2000/svg',
82-
'svg',
83-
);
84-
const root = ReactDOMClient.createRoot(container);
85-
await act(() => {
86-
root.render(<g dangerouslySetInnerHTML={{__html: firstHtml}} />);
87-
});
88-
const rect = container.firstChild.firstChild;
89-
expect(rect.tagName).toBe('rect');
90-
await act(() => {
91-
root.render(<g dangerouslySetInnerHTML={{__html: secondHtml}} />);
92-
});
93-
const circle = container.firstChild.firstChild;
94-
expect(circle.tagName).toBe('circle');
95-
});
9661
});
9762
});

0 commit comments

Comments
 (0)