2018-07-31 16:57:16 +01:00
|
|
|
use wasm_bindgen::prelude::*;
|
2018-09-26 08:26:00 -07:00
|
|
|
use wasm_bindgen_test::*;
|
2018-07-31 16:57:16 +01:00
|
|
|
use web_sys::HtmlTitleElement;
|
|
|
|
|
2019-02-26 08:33:14 -08:00
|
|
|
#[wasm_bindgen(module = "/tests/wasm/element.js")]
|
2018-09-26 08:26:00 -07:00
|
|
|
extern "C" {
|
2018-07-31 16:57:16 +01:00
|
|
|
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");
|
|
|
|
}
|