mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-28 23:14:12 +03:00
17 lines
475 B
Rust
17 lines
475 B
Rust
|
use wasm_bindgen_test::*;
|
||
|
use wasm_bindgen::prelude::*;
|
||
|
use web_sys::HtmlTitleElement;
|
||
|
|
||
|
#[wasm_bindgen(module = "./tests/wasm/element.js")]
|
||
|
extern {
|
||
|
fn new_title() -> HtmlTitleElement;
|
||
|
}
|
||
|
|
||
|
#[wasm_bindgen_test]
|
||
|
fn title_element() {
|
||
|
let element = new_title();
|
||
|
assert_eq!(element.text().unwrap(), "", "Shouldn't have an text");
|
||
|
assert_eq!(element.set_text("page text").unwrap(), ());
|
||
|
assert_eq!(element.text().unwrap(), "page text", "Should have an text");
|
||
|
}
|