Skip to content

Commit 6313cc9

Browse files
committed
test: add test case.
1 parent b4d0344 commit 6313cc9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/index.test.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,17 @@ it('renders <IFrame head="..." /> test case', async () => {
8282
await waitFor(() => {
8383
expect(container.innerHTML).toEqual(`<iframe srcdoc="<!DOCTYPE html><html><head></head><body></body></html>"></iframe>`);
8484
});
85-
});
85+
});
86+
87+
it('renders <IFrame mountTarget="..." /> test case', async () => {
88+
const initialContent = '<!DOCTYPE html><html><head></head><body><h1>i wont be changed</h1><div id="mountHere"></div></body></html>';
89+
const { container } = render(
90+
<IFrame initialContent={initialContent} mountTarget="#mountHere">
91+
<div style={{ fontSize: 32, color: 'red' }}>Hello World!</div>
92+
</IFrame>
93+
);
94+
await waitFor(() => {
95+
expect(container.innerHTML).toEqual(`<iframe srcdoc=\"<!DOCTYPE html><html><head></head><body><h1>i wont be changed</h1><div id=&quot;mountHere&quot;></div></body></html>\"></iframe>`);
96+
});
97+
});
98+

0 commit comments

Comments
 (0)