mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-25 19:11:45 +03:00
Add unit test for HtmlHrElement web_sys binding (#591)
This commit is contained in:
parent
05d3b934c8
commit
c971620039
@ -205,7 +205,7 @@ bindings are fully working and have full test coverage.
|
||||
- [ ] HTMLFrameSetElement.webidl
|
||||
- [ ] HTMLHeadElement.webidl
|
||||
- [ ] HTMLHeadingElement.webidl
|
||||
- [ ] HTMLHRElement.webidl
|
||||
- [x] HTMLHRElement.webidl
|
||||
- [ ] HTMLHtmlElement.webidl
|
||||
- [ ] HTMLHyperlinkElementUtils.webidl
|
||||
- [ ] HTMLIFrameElement.webidl
|
||||
@ -647,7 +647,7 @@ bindings are fully working and have full test coverage.
|
||||
- [ ] XPathEvaluator.webidl
|
||||
- [ ] XPathExpression.webidl
|
||||
- [ ] XPathNSResolver.webidl
|
||||
- [ ] XPathResult.webidl
|
||||
- [x] XPathResult.webidl
|
||||
- [ ] XSLTProcessor.webidl
|
||||
- [ ] README.md
|
||||
- [ ] WaveShaperNode.webidl
|
||||
|
@ -26,6 +26,10 @@ export function new_head() {
|
||||
return document.createElement("head");
|
||||
}
|
||||
|
||||
export function new_hr() {
|
||||
return document.createElement("hr");
|
||||
}
|
||||
|
||||
export function new_html() {
|
||||
return document.createElement("html");
|
||||
}
|
||||
|
24
crates/web-sys/tests/wasm/hr_element.rs
Normal file
24
crates/web-sys/tests/wasm/hr_element.rs
Normal file
@ -0,0 +1,24 @@
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use web_sys::HtmlHrElement;
|
||||
|
||||
#[wasm_bindgen(module = "./tests/wasm/element.js")]
|
||||
extern {
|
||||
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);
|
||||
}
|
@ -17,6 +17,7 @@ pub mod element;
|
||||
pub mod head_element;
|
||||
pub mod headers;
|
||||
pub mod history;
|
||||
pub mod hr_element;
|
||||
pub mod html_element;
|
||||
pub mod html_html_element;
|
||||
pub mod response;
|
||||
|
Loading…
Reference in New Issue
Block a user