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 d0a6ad8
Show file tree
Hide file tree
Showing 2 changed files with 8 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
7 changes: 5 additions & 2 deletions platforms/web/lib/useWysiwyg.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,16 @@ 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>';

Check failure on line 152 in platforms/web/lib/useWysiwyg.test.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `⏎···········`

// 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 d0a6ad8

Please sign in to comment.