2018-08-01 18:11:29 -05:00
|
|
|
use wasm_bindgen::prelude::*;
|
2018-09-26 08:26:00 -07:00
|
|
|
use wasm_bindgen_test::*;
|
2018-08-01 18:11:29 -05:00
|
|
|
use web_sys::HtmlParagraphElement;
|
|
|
|
|
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-08-01 18:11:29 -05:00
|
|
|
fn new_paragraph() -> HtmlParagraphElement;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen_test]
|
|
|
|
fn test_paragraph_element() {
|
|
|
|
let paragraph = new_paragraph();
|
|
|
|
paragraph.set_align("right");
|
2018-09-26 08:26:00 -07:00
|
|
|
assert_eq!(
|
|
|
|
paragraph.align(),
|
|
|
|
"right",
|
|
|
|
"Paragraph should be aligned 'right'."
|
|
|
|
);
|
|
|
|
}
|