@@ -2207,4 +2207,42 @@ mod tests {
22072207 assert ! ( css. contains( "@layer components" ) ) ;
22082208 assert_debug_snapshot ! ( css. split( "*/" ) . nth( 1 ) . unwrap( ) ) ;
22092209 }
2210+
2211+ #[ test]
2212+ fn test_stylesheet_css_extract ( ) {
2213+ let css_entry = StyleSheetCss {
2214+ css : "div{display:flex}" . to_string ( ) ,
2215+ } ;
2216+ assert_eq ! ( css_entry. extract( ) , "div{display:flex}" ) ;
2217+
2218+ let empty = StyleSheetCss { css : String :: new ( ) } ;
2219+ assert_eq ! ( empty. extract( ) , "" ) ;
2220+ }
2221+
2222+ #[ test]
2223+ fn test_keyframes_multi_property ( ) {
2224+ let mut sheet = StyleSheet :: default ( ) ;
2225+ let mut keyframes: BTreeMap < String , Vec < ( String , String ) > > = BTreeMap :: new ( ) ;
2226+ // Multiple properties in a single keyframe step to cover the semicolon separator (line 548)
2227+ keyframes. insert (
2228+ String :: from ( "from" ) ,
2229+ vec ! [
2230+ ( String :: from( "opacity" ) , String :: from( "0" ) ) ,
2231+ ( String :: from( "transform" ) , String :: from( "scale(0.5)" ) ) ,
2232+ ] ,
2233+ ) ;
2234+ keyframes. insert (
2235+ String :: from ( "to" ) ,
2236+ vec ! [
2237+ ( String :: from( "opacity" ) , String :: from( "1" ) ) ,
2238+ ( String :: from( "transform" ) , String :: from( "scale(1)" ) ) ,
2239+ ] ,
2240+ ) ;
2241+ sheet. add_keyframes ( "slideIn" , keyframes, None ) ;
2242+ let css = sheet. create_css ( None , false ) ;
2243+ // Verify semicolon separator between multiple properties in a keyframe step
2244+ assert ! ( css. contains( "opacity:0;transform:scale(0.5)" ) ) ;
2245+ assert ! ( css. contains( "opacity:1;transform:scale(1)" ) ) ;
2246+ assert_debug_snapshot ! ( css. split( "*/" ) . nth( 1 ) . unwrap( ) ) ;
2247+ }
22102248}
0 commit comments