mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-07-31 20:11:55 +00:00
Use the JS name of an imported type for instanceof
checks
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::HtmlElement;
|
||||
|
||||
#[wasm_bindgen(module = "./tests/wasm/element.js")]
|
||||
@@ -10,6 +11,8 @@ extern {
|
||||
#[wasm_bindgen_test]
|
||||
fn test_html_element() {
|
||||
let element = new_html();
|
||||
assert!(element.is_instance_of::<HtmlElement>());
|
||||
|
||||
assert_eq!(element.title(), "", "Shouldn't have a title");
|
||||
element.set_title("boop");
|
||||
assert_eq!(element.title(), "boop", "Should have a title");
|
||||
|
Reference in New Issue
Block a user