Use the JS name of an imported type for instanceof checks

This commit is contained in:
Nick Fitzgerald
2018-08-07 16:18:13 -07:00
parent 9104bf87e9
commit 998d37a353
6 changed files with 31 additions and 2 deletions

View File

@@ -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");