Skip to content

Commit d2cef82

Browse files
committed
Add testcase
1 parent 35092d6 commit d2cef82

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

libs/extractor/src/css_utils.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,19 @@ mod tests {
656656
("font-family", "\"Roboto Hello\",sans-serif", Some(StyleSelector::Selector("ul".to_string()))),
657657
]
658658
)]
659+
#[case(
660+
"`&:hover { background-color: red; }`",
661+
vec![
662+
("background-color", "red", Some(StyleSelector::Selector("&:hover".to_string()))),
663+
]
664+
)]
665+
#[case(
666+
"`background-color: red; &:hover { background-color: red; }`",
667+
vec![
668+
("background-color", "red", None),
669+
("background-color", "red", Some(StyleSelector::Selector("&:hover".to_string()))),
670+
]
671+
)]
659672
fn test_css_to_style_literal(
660673
#[case] input: &str,
661674
#[case] expected: Vec<(&str, &str, Option<StyleSelector>)>,

0 commit comments

Comments
 (0)