mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-26 11:34:22 +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
|
- [ ] HTMLFrameSetElement.webidl
|
||||||
- [ ] HTMLHeadElement.webidl
|
- [ ] HTMLHeadElement.webidl
|
||||||
- [ ] HTMLHeadingElement.webidl
|
- [ ] HTMLHeadingElement.webidl
|
||||||
- [ ] HTMLHRElement.webidl
|
- [x] HTMLHRElement.webidl
|
||||||
- [ ] HTMLHtmlElement.webidl
|
- [ ] HTMLHtmlElement.webidl
|
||||||
- [ ] HTMLHyperlinkElementUtils.webidl
|
- [ ] HTMLHyperlinkElementUtils.webidl
|
||||||
- [ ] HTMLIFrameElement.webidl
|
- [ ] HTMLIFrameElement.webidl
|
||||||
@ -647,7 +647,7 @@ bindings are fully working and have full test coverage.
|
|||||||
- [ ] XPathEvaluator.webidl
|
- [ ] XPathEvaluator.webidl
|
||||||
- [ ] XPathExpression.webidl
|
- [ ] XPathExpression.webidl
|
||||||
- [ ] XPathNSResolver.webidl
|
- [ ] XPathNSResolver.webidl
|
||||||
- [ ] XPathResult.webidl
|
- [x] XPathResult.webidl
|
||||||
- [ ] XSLTProcessor.webidl
|
- [ ] XSLTProcessor.webidl
|
||||||
- [ ] README.md
|
- [ ] README.md
|
||||||
- [ ] WaveShaperNode.webidl
|
- [ ] WaveShaperNode.webidl
|
||||||
|
@ -26,6 +26,10 @@ export function new_head() {
|
|||||||
return document.createElement("head");
|
return document.createElement("head");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function new_hr() {
|
||||||
|
return document.createElement("hr");
|
||||||
|
}
|
||||||
|
|
||||||
export function new_html() {
|
export function new_html() {
|
||||||
return document.createElement("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 head_element;
|
||||||
pub mod headers;
|
pub mod headers;
|
||||||
pub mod history;
|
pub mod history;
|
||||||
|
pub mod hr_element;
|
||||||
pub mod html_element;
|
pub mod html_element;
|
||||||
pub mod html_html_element;
|
pub mod html_html_element;
|
||||||
pub mod response;
|
pub mod response;
|
||||||
|
Loading…
Reference in New Issue
Block a user