wasm-bindgen/crates/web-sys/tests/wasm/pre_element.rs
Tyler Wilcock e3546863bb Add unit tests for various 'web-sys' HTML element bindings
That list includes:
 * HtmlOptionsCollection
 * HtmlOutputElement
 * HtmlParagraphElement
 * HtmlParamElement
 * HtmlPreElement
 * HtmlProgressElement
 * HtmlQuoteElement
 * HtmlSlotElement
2018-08-01 18:14:03 -05:00

15 lines
343 B
Rust

use wasm_bindgen_test::*;
use wasm_bindgen::prelude::*;
use web_sys::HtmlPreElement;
#[wasm_bindgen(module = "./tests/wasm/element.js")]
extern {
fn new_pre() -> HtmlPreElement;
}
#[wasm_bindgen_test]
fn test_pre_element() {
let pre = new_pre();
pre.set_width(150);
assert_eq!(pre.width(), 150, "Pre width should be 150.");
}