meta_element.rs 937 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. use wasm_bindgen::prelude::*;
  2. use wasm_bindgen_test::*;
  3. use web_sys::HtmlMetaElement;
  4. #[wasm_bindgen(module = "/tests/wasm/element.js")]
  5. extern "C" {
  6. fn new_meta() -> HtmlMetaElement;
  7. }
  8. #[wasm_bindgen_test]
  9. fn test_meter_element() {
  10. let meta = new_meta();
  11. meta.set_name("keywords");
  12. assert_eq!(
  13. meta.name(),
  14. "keywords",
  15. "Meta should have the name value we gave it."
  16. );
  17. meta.set_http_equiv("content-type");
  18. assert_eq!(
  19. meta.http_equiv(),
  20. "content-type",
  21. "Meta should have the http_equiv value we gave it."
  22. );
  23. meta.set_content("HTML, CSS, XML, JavaScript");
  24. assert_eq!(
  25. meta.content(),
  26. "HTML, CSS, XML, JavaScript",
  27. "Meta should have the content value we gave it."
  28. );
  29. meta.set_scheme("text");
  30. assert_eq!(
  31. meta.scheme(),
  32. "text",
  33. "Meta should have the scheme value we gave it."
  34. );
  35. }