Skip to content

Commit 3249963

Browse files
committed
Add ignore special prop case to test
1 parent 546d41e commit 3249963

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

libs/extractor/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,20 @@ mod tests {
234234
.unwrap());
235235
}
236236
#[test]
237+
fn ignore_special_props() {
238+
assert_debug_snapshot!(extract(
239+
"test.tsx",
240+
r"import {Box} from '@devup-ui/core'
241+
<Box padding={1} ref={ref} data-test={1} role={2} children={[]} onClick={()=>{}} aria-valuenow={24} key={2} />
242+
",
243+
ExtractOption {
244+
package: "@devup-ui/core".to_string(),
245+
css_file: None
246+
}
247+
)
248+
.unwrap());
249+
}
250+
#[test]
237251
fn extract_style_props() {
238252
assert_debug_snapshot!(extract(
239253
"test.tsx",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
source: libs/extractor/src/lib.rs
3+
expression: "extract(\"test.tsx\",\nr\"import {Box} from '@devup-ui/core'\n <Box padding={1} ref={ref} data-test={1} role={2} children={[]} onClick={()=>{}} aria-valuenow={24} key={2} />\n \",\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap()"
4+
---
5+
ExtractOutput {
6+
styles: [
7+
Static(
8+
ExtractStaticStyle {
9+
property: "padding",
10+
value: "4px",
11+
level: 0,
12+
},
13+
),
14+
],
15+
code: "import \"@devup-ui/core/devup-ui.css\";\nimport { Box } from \"@devup-ui/core\";\n<div ref={ref} data-test={1} role={2} children={[]} onClick={() => {}} aria-valuenow={24} key={2} className=\"d13564892828075531325\" />;\n",
16+
}

0 commit comments

Comments
 (0)