Skip to content

Commit a1aa9bb

Browse files
committed
Fix testcase
1 parent 23ebad7 commit a1aa9bb

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

libs/extractor/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13475,13 +13475,14 @@ export const Card = () => (
1347513475
#[serial]
1347613476
fn test_tailwind_template_literal_with_style_order() {
1347713477
// Test style_order parameter in build_tailwind_class_mapping (covers line 178)
13478+
// styleOrder prop must be set explicitly to trigger the style_order code path
1347813479
reset_class_map();
1347913480
reset_file_map();
1348013481
assert_debug_snapshot!(ToBTreeSet::from(
1348113482
extract(
1348213483
"test.tsx",
1348313484
r#"import {Box} from '@devup-ui/core'
13484-
<Box bg="blue" className={`${enabled ? 'text-green-500' : 'text-blue-500'} p-4`}>
13485+
<Box styleOrder={5} className={`${enabled ? 'text-green-500' : 'text-blue-500'} p-4`}>
1348513486
hello
1348613487
</Box>
1348713488
"#,

libs/extractor/src/snapshots/extractor__tests__tailwind_template_literal_with_style_order.snap

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
---
22
source: libs/extractor/src/lib.rs
3-
expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import {Box} from '@devup-ui/core'\n<Box bg=\"blue\" className={`${enabled ? 'text-green-500' : 'text-blue-500'} p-4`}>\n hello\n</Box>\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_dir:\n \"@devup-ui/core\".to_string(), single_css: true, import_main_css: false,\n import_aliases: HashMap::new()\n}).unwrap())"
3+
expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import {Box} from '@devup-ui/core'\n<Box styleOrder={5} className={`${enabled ? 'text-green-500' : 'text-blue-500'} p-4`}>\n hello\n</Box>\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_dir:\n \"@devup-ui/core\".to_string(), single_css: true, import_main_css: false,\n import_aliases: HashMap::new()\n}).unwrap())"
44
---
55
ToBTreeSet {
66
styles: {
7-
Static(
8-
ExtractStaticStyle {
9-
property: "background",
10-
value: "blue",
11-
level: 0,
12-
selector: None,
13-
style_order: None,
14-
layer: None,
15-
},
16-
),
177
Static(
188
ExtractStaticStyle {
199
property: "color",
@@ -45,5 +35,5 @@ ToBTreeSet {
4535
},
4636
),
4737
},
48-
code: "import \"@devup-ui/core/devup-ui.css\";\n<div className={`${enabled ? \"b\" : \"c\"} a d`}>\n hello\n</div>;\n",
38+
code: "import \"@devup-ui/core/devup-ui.css\";\n<div className={`${enabled ? \"b\" : \"c\"} a`}>\n hello\n</div>;\n",
4939
}

0 commit comments

Comments
 (0)