2018-07-30 20:25:48 -05:00
|
|
|
use wasm_bindgen::prelude::*;
|
2018-09-26 08:26:00 -07:00
|
|
|
use wasm_bindgen_test::*;
|
2018-07-30 20:25:48 -05:00
|
|
|
use web_sys::HtmlHrElement;
|
|
|
|
|
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-30 20:25:48 -05:00
|
|
|
fn new_hr() -> HtmlHrElement;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen_test]
|
|
|
|
fn test_hr_element() {
|
|
|
|
let hr = new_hr();
|
|
|
|
hr.set_color("blue");
|
|
|
|
assert_eq!(hr.color(), "blue");
|
|
|
|
|
|
|
|
hr.set_width("128");
|
|
|
|
assert_eq!(hr.width(), "128");
|
|
|
|
|
|
|
|
hr.set_width("256");
|
|
|
|
assert_eq!(hr.width(), "256");
|
|
|
|
|
|
|
|
hr.set_no_shade(true);
|
|
|
|
assert_eq!(hr.no_shade(), true);
|
2018-09-26 08:26:00 -07:00
|
|
|
}
|