Skip to content

Commit

Permalink
Fix CI errors (#1925)
Browse files Browse the repository at this point in the history
* fix website npm lock-file

* clippy
  • Loading branch information
ranile authored Jun 19, 2021
1 parent c5e99b3 commit ab81dba
Show file tree
Hide file tree
Showing 4 changed files with 2,214 additions and 1,840 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
paths:
- "website/**"
- "firebase.json"
- ".github/workflows/*-website.yml"
push:
branches: [master]
paths:
- "website/**"
- "firebase.json"
- ".github/workflows/*-website.yml"

jobs:
build:
Expand Down
58 changes: 29 additions & 29 deletions packages/yew-validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,58 +175,58 @@ mod tests {

#[test]
fn valid_custom_element() {
assert_eq!(is_valid_html_custom_element_name("foo-bar"), true);
assert_eq!(is_valid_html_custom_element_name("foo-"), true);
assert_eq!(is_valid_html_custom_element_name("bar-baz"), true);
assert!(is_valid_html_custom_element_name("foo-bar"));
assert!(is_valid_html_custom_element_name("foo-"));
assert!(is_valid_html_custom_element_name("bar-baz"));
}

#[test]
fn invalid_custom_element() {
assert_eq!(is_valid_html_custom_element_name("foobar"), false);
assert_eq!(is_valid_html_custom_element_name("-bar"), false);
assert_eq!(is_valid_html_custom_element_name("foo bar"), false);
assert_eq!(is_valid_html_custom_element_name(""), false);
assert_eq!(is_valid_html_custom_element_name("foo\nbar"), false);
assert_eq!(is_valid_html_custom_element_name("-"), false);
assert!(!is_valid_html_custom_element_name("foobar"));
assert!(!is_valid_html_custom_element_name("-bar"));
assert!(!is_valid_html_custom_element_name("foo bar"));
assert!(!is_valid_html_custom_element_name(""));
assert!(!is_valid_html_custom_element_name("foo\nbar"));
assert!(!is_valid_html_custom_element_name("-"));
}

#[test]
fn valid_html_element() {
assert_eq!(resembles_standard_html_element_name("section"), true);
assert_eq!(resembles_standard_html_element_name("h2"), true);
assert_eq!(resembles_standard_html_element_name("applet"), true);
assert_eq!(resembles_standard_html_element_name("appLET"), true);
assert_eq!(resembles_standard_html_element_name("aPPlet"), true);
assert_eq!(resembles_standard_html_element_name("foo-bar"), true);
assert!(resembles_standard_html_element_name("section"));
assert!(resembles_standard_html_element_name("h2"));
assert!(resembles_standard_html_element_name("applet"));
assert!(resembles_standard_html_element_name("appLET"));
assert!(resembles_standard_html_element_name("aPPlet"));
assert!(resembles_standard_html_element_name("foo-bar"));
}

#[test]
fn invalid_html_element() {
assert_eq!(resembles_standard_html_element_name(" foo"), false);
assert_eq!(resembles_standard_html_element_name("foo "), false);
assert_eq!(resembles_standard_html_element_name("-"), false);
assert_eq!(resembles_standard_html_element_name("!doctype"), false);
assert!(!resembles_standard_html_element_name(" foo"));
assert!(!resembles_standard_html_element_name("foo "));
assert!(!resembles_standard_html_element_name("-"));
assert!(!resembles_standard_html_element_name("!doctype"));
}

#[test]
fn valid_html_attribute() {
assert_eq!(is_valid_html_attribute_name("-foo-bar"), true);
assert_eq!(is_valid_html_attribute_name("data-foobar"), true);
assert_eq!(is_valid_html_attribute_name("foo<bar"), true); // shocking but true
assert!(is_valid_html_attribute_name("-foo-bar"));
assert!(is_valid_html_attribute_name("data-foobar"));
assert!(is_valid_html_attribute_name("foo<bar")); // shocking but true
}

#[test]
fn invalid_html_attribute() {
assert_eq!(is_valid_html_attribute_name("foo=bar"), false);
assert_eq!(is_valid_html_attribute_name("\"foo\""), false);
assert_eq!(is_valid_html_attribute_name("foo bar"), false);
assert_eq!(is_valid_html_attribute_name("foo>bar"), false);
assert!(!is_valid_html_attribute_name("foo=bar"));
assert!(!is_valid_html_attribute_name("\"foo\""));
assert!(!is_valid_html_attribute_name("foo bar"));
assert!(!is_valid_html_attribute_name("foo>bar"));
}

#[test]
fn invalid_sgml_tag() {
assert_eq!(is_valid_sgml_tag("f>bar"), false);
assert_eq!(is_valid_sgml_tag("f<bar"), false);
assert_eq!(is_valid_sgml_tag("/>"), false);
assert!(!is_valid_sgml_tag("f>bar"));
assert!(!is_valid_sgml_tag("f<bar"));
assert!(!is_valid_sgml_tag("/>"));
}
}
2 changes: 1 addition & 1 deletion packages/yew/src/html/classes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl<T: Into<Classes>> From<Vec<T>> for Classes {

impl<T: Into<Classes> + Clone> From<&[T]> for Classes {
fn from(t: &[T]) -> Self {
Self::from_iter(t.iter().cloned())
t.iter().cloned().collect()
}
}

Expand Down
Loading

0 comments on commit ab81dba

Please sign in to comment.