mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-08-01 04:21:55 +00:00
Move web-sys
tests to the new test framework
Migrate most `web-sys` tests to the new `wasm_bindgen_test` framework with the new headless browser capabilities!
This commit is contained in:
17
crates/web-sys/tests/wasm/div_element.rs
Normal file
17
crates/web-sys/tests/wasm/div_element.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use web_sys::HtmlDivElement;
|
||||
|
||||
#[wasm_bindgen(module = "./tests/wasm/element.js")]
|
||||
extern {
|
||||
#[wasm_bindgen(js_name = new_div)]
|
||||
fn make_div() -> HtmlDivElement;
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn test_div_element() {
|
||||
let element = make_div();
|
||||
assert_eq!(element.align(), "", "Shouldn't have a align");
|
||||
element.set_align("right");
|
||||
assert_eq!(element.align(), "right", "Should have a align");
|
||||
}
|
Reference in New Issue
Block a user