@@ -3487,3 +3487,76 @@ describe("ICSS :export pseudo-selector", () => {
34873487 ) . toThrow ( ) ;
34883488 } ) ;
34893489} ) ;
3490+
3491+ describe ( "::part() selectors" , ( ) => {
3492+ it ( "transforms ::part() selectors" , ( ) => {
3493+ expect (
3494+ transform (
3495+ `
3496+ .container {
3497+ background-color: #f00;
3498+ }
3499+
3500+ .container::part(input) {
3501+ background-color: #00f;
3502+ }
3503+ ` ,
3504+ {
3505+ parsePartSelectors : true ,
3506+ } ,
3507+ ) ,
3508+ ) . toEqual ( {
3509+ container : {
3510+ backgroundColor : "#f00" ,
3511+ } ,
3512+ "container::part(input)" : {
3513+ backgroundColor : "#00f" ,
3514+ } ,
3515+ } ) ;
3516+ } ) ;
3517+
3518+ it ( "does not transform ::part() selectors without option enabled" , ( ) => {
3519+ expect (
3520+ transform (
3521+ `
3522+ .container {
3523+ background-color: #f00;
3524+ }
3525+
3526+ .container::part(input) {
3527+ background-color: #00f;
3528+ }
3529+ ` ,
3530+ { } ,
3531+ ) ,
3532+ ) . toEqual ( {
3533+ container : {
3534+ backgroundColor : "#f00" ,
3535+ } ,
3536+ } ) ;
3537+
3538+ expect (
3539+ transform (
3540+ `
3541+ .container {
3542+ background-color: #f00;
3543+ }
3544+
3545+ .container::part(input) {
3546+ background-color: #00f;
3547+ }
3548+ ` ,
3549+ {
3550+ parsePartSelectors : true ,
3551+ } ,
3552+ ) ,
3553+ ) . toEqual ( {
3554+ container : {
3555+ backgroundColor : "#f00" ,
3556+ } ,
3557+ "container::part(input)" : {
3558+ backgroundColor : "#00f" ,
3559+ } ,
3560+ } ) ;
3561+ } ) ;
3562+ } ) ;
0 commit comments