From 74337c9dbbb54409bce7797c80abdf20d27a2339 Mon Sep 17 00:00:00 2001 From: jonnyandrew Date: Wed, 4 Oct 2023 17:15:19 +0100 Subject: [PATCH] Update web test --- crates/wysiwyg/src/dom/parser/parse.rs | 4 +++- platforms/web/lib/useWysiwyg.test.tsx | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/wysiwyg/src/dom/parser/parse.rs b/crates/wysiwyg/src/dom/parser/parse.rs index c1dceb743..4c1fe5215 100644 --- a/crates/wysiwyg/src/dom/parser/parse.rs +++ b/crates/wysiwyg/src/dom/parser/parse.rs @@ -1404,7 +1404,9 @@ mod js { #[wasm_bindgen_test] fn br() { - roundtrip("foo
bar"); + let html = "foo
bar"; + let dom = HtmlParser::default().parse::(html).unwrap(); + assert_eq!(dom.to_string(), "

foo

bar

"); } #[wasm_bindgen_test] diff --git a/platforms/web/lib/useWysiwyg.test.tsx b/platforms/web/lib/useWysiwyg.test.tsx index 14b5251ba..0afc2b419 100644 --- a/platforms/web/lib/useWysiwyg.test.tsx +++ b/platforms/web/lib/useWysiwyg.test.tsx @@ -147,13 +147,17 @@ describe('useWysiwyg', () => { }); test('Create wysiwyg with initial content', async () => { - // When + // Given const content = 'foo
bar'; + const processedContent = + '

foo

bar

'; + + // When render(); // Then await waitFor(() => - expect(screen.getByRole('textbox')).toContainHTML(content), + expect(screen.getByRole('textbox')).toContainHTML(processedContent), ); });