@@ -8342,6 +8342,170 @@ keyframes({
83428342 ) ) ;
83438343 }
83448344
8345+ #[ test]
8346+ #[ serial]
8347+ fn test_styled_with_spread ( ) {
8348+ reset_class_map ( ) ;
8349+ // Test styled with spread element
8350+ assert_debug_snapshot ! ( ToBTreeSet :: from(
8351+ extract(
8352+ "test.tsx" ,
8353+ r#"import {styled} from '@devup-ui/core'
8354+ const baseStyles = { bg: "red" };
8355+ const StyledDiv = styled.div({ ...baseStyles })
8356+ "# ,
8357+ ExtractOption {
8358+ package: "@devup-ui/core" . to_string( ) ,
8359+ css_dir: "@devup-ui/core" . to_string( ) ,
8360+ single_css: false ,
8361+ import_main_css: false
8362+ }
8363+ )
8364+ . unwrap( )
8365+ ) ) ;
8366+ }
8367+
8368+ #[ test]
8369+ #[ serial]
8370+ fn test_css_function_no_args ( ) {
8371+ reset_class_map ( ) ;
8372+ // Test css() with no arguments
8373+ assert_debug_snapshot ! ( ToBTreeSet :: from(
8374+ extract(
8375+ "test.tsx" ,
8376+ r#"import {css} from '@devup-ui/core'
8377+ const className = css()
8378+ "# ,
8379+ ExtractOption {
8380+ package: "@devup-ui/core" . to_string( ) ,
8381+ css_dir: "@devup-ui/core" . to_string( ) ,
8382+ single_css: false ,
8383+ import_main_css: false
8384+ }
8385+ )
8386+ . unwrap( )
8387+ ) ) ;
8388+ }
8389+
8390+ #[ test]
8391+ #[ serial]
8392+ fn test_css_function_empty_object ( ) {
8393+ reset_class_map ( ) ;
8394+ // Test css() with empty object
8395+ assert_debug_snapshot ! ( ToBTreeSet :: from(
8396+ extract(
8397+ "test.tsx" ,
8398+ r#"import {css} from '@devup-ui/core'
8399+ const className = css({})
8400+ "# ,
8401+ ExtractOption {
8402+ package: "@devup-ui/core" . to_string( ) ,
8403+ css_dir: "@devup-ui/core" . to_string( ) ,
8404+ single_css: false ,
8405+ import_main_css: false
8406+ }
8407+ )
8408+ . unwrap( )
8409+ ) ) ;
8410+ }
8411+
8412+ #[ test]
8413+ #[ serial]
8414+ fn test_keyframes_function ( ) {
8415+ reset_class_map ( ) ;
8416+ // Test keyframes() function
8417+ assert_debug_snapshot ! ( ToBTreeSet :: from(
8418+ extract(
8419+ "test.tsx" ,
8420+ r#"import {keyframes} from '@devup-ui/core'
8421+ const spin = keyframes({
8422+ from: { transform: "rotate(0deg)" },
8423+ to: { transform: "rotate(360deg)" }
8424+ })
8425+ "# ,
8426+ ExtractOption {
8427+ package: "@devup-ui/core" . to_string( ) ,
8428+ css_dir: "@devup-ui/core" . to_string( ) ,
8429+ single_css: false ,
8430+ import_main_css: false
8431+ }
8432+ )
8433+ . unwrap( )
8434+ ) ) ;
8435+ }
8436+
8437+ #[ test]
8438+ #[ serial]
8439+ fn test_global_css_function ( ) {
8440+ reset_class_map ( ) ;
8441+ // Test globalCss() function
8442+ assert_debug_snapshot ! ( ToBTreeSet :: from(
8443+ extract(
8444+ "test.tsx" ,
8445+ r#"import {globalCss} from '@devup-ui/core'
8446+ globalCss({
8447+ body: { margin: 0, padding: 0 }
8448+ })
8449+ "# ,
8450+ ExtractOption {
8451+ package: "@devup-ui/core" . to_string( ) ,
8452+ css_dir: "@devup-ui/core" . to_string( ) ,
8453+ single_css: false ,
8454+ import_main_css: false
8455+ }
8456+ )
8457+ . unwrap( )
8458+ ) ) ;
8459+ }
8460+
8461+ #[ test]
8462+ #[ serial]
8463+ fn test_conditional_styles ( ) {
8464+ reset_class_map ( ) ;
8465+ // Test conditional styles with both branches having different properties
8466+ assert_debug_snapshot ! ( ToBTreeSet :: from(
8467+ extract(
8468+ "test.tsx" ,
8469+ r#"import {Box} from '@devup-ui/core'
8470+ const Component = () => {
8471+ const isActive = true;
8472+ return <Box bg={isActive ? "red" : undefined} color={isActive ? undefined : "blue"} />;
8473+ }
8474+ "# ,
8475+ ExtractOption {
8476+ package: "@devup-ui/core" . to_string( ) ,
8477+ css_dir: "@devup-ui/core" . to_string( ) ,
8478+ single_css: false ,
8479+ import_main_css: false
8480+ }
8481+ )
8482+ . unwrap( )
8483+ ) ) ;
8484+ }
8485+
8486+ #[ test]
8487+ #[ serial]
8488+ fn test_css_variable_reassignment ( ) {
8489+ reset_class_map ( ) ;
8490+ // Test css import reassignment
8491+ assert_debug_snapshot ! ( ToBTreeSet :: from(
8492+ extract(
8493+ "test.tsx" ,
8494+ r#"import {css as cssFunction} from '@devup-ui/core'
8495+ const myCss = cssFunction;
8496+ const className = myCss({ bg: "red" })
8497+ "# ,
8498+ ExtractOption {
8499+ package: "@devup-ui/core" . to_string( ) ,
8500+ css_dir: "@devup-ui/core" . to_string( ) ,
8501+ single_css: false ,
8502+ import_main_css: false
8503+ }
8504+ )
8505+ . unwrap( )
8506+ ) ) ;
8507+ }
8508+
83458509 #[ rstest]
83468510 #[ case( "test.tsx" , "const x = 1;" , "@devup-ui/react" , false ) ] // no package string
83478511 #[ case(
0 commit comments