Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Update web test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnyandrew committed Oct 4, 2023
1 parent 519ff31 commit 74337c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion crates/wysiwyg/src/dom/parser/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,9 @@ mod js {

#[wasm_bindgen_test]
fn br() {
roundtrip("foo<br />bar");
let html = "foo<br />bar";
let dom = HtmlParser::default().parse::<Utf16String>(html).unwrap();
assert_eq!(dom.to_string(), "<p>foo</p><p>bar</p>");
}

#[wasm_bindgen_test]
Expand Down
8 changes: 6 additions & 2 deletions platforms/web/lib/useWysiwyg.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,17 @@ describe('useWysiwyg', () => {
});

test('Create wysiwyg with initial content', async () => {
// When
// Given
const content = 'fo<strong>o</strong><br />b<em>ar</em>';
const processedContent =
'<p>fo<strong>o</strong></p><p>b<em>ar</em></p>';

// When
render(<Editor initialContent={content} />);

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

Expand Down

0 comments on commit 74337c9

Please sign in to comment.