@@ -15,28 +15,45 @@ describe('CustomStateSet polyfill', () => {
15
15
fixtureCleanup ( ) ;
16
16
} ) ;
17
17
18
- describe ( 'it will add attributes' , async ( ) => {
18
+ describe ( 'it will add attributes and parts ' , async ( ) => {
19
19
set . add ( '--foo' ) ;
20
20
expect ( el . hasAttribute ( 'state--foo' ) ) . to . be . true ;
21
+ if ( el . part ) {
22
+ expect ( el . part . contains ( 'state--foo' ) ) . to . be . true ;
23
+ }
21
24
} ) ;
22
25
23
- describe ( 'it will remove attributes' , async ( ) => {
26
+ describe ( 'it will remove attributes and parts ' , async ( ) => {
24
27
set . add ( '--foo' ) ;
25
28
expect ( el . hasAttribute ( 'state--foo' ) ) . to . be . true ;
29
+ if ( el . part ) {
30
+ expect ( el . part . contains ( 'state--foo' ) ) . to . be . true ;
31
+ }
26
32
27
33
set . delete ( '--foo' ) ;
28
34
expect ( el . hasAttribute ( 'state--foo' ) ) . to . be . false ;
35
+ if ( el . part ) {
36
+ expect ( el . part . contains ( 'state--foo' ) ) . to . be . false ;
37
+ }
29
38
} ) ;
30
39
31
- describe ( 'it will clear all attributes' , async ( ) => {
40
+ describe ( 'it will clear all attributes and parts ' , async ( ) => {
32
41
set . add ( '--foo' ) ;
33
42
set . add ( '--bar' ) ;
34
43
35
44
expect ( el . hasAttribute ( 'state--foo' ) ) . to . be . true ;
36
45
expect ( el . hasAttribute ( 'state--bar' ) ) . to . be . true ;
46
+ if ( el . part ) {
47
+ expect ( el . part . contains ( 'state--foo' ) ) . to . be . true ;
48
+ expect ( el . part . contains ( 'state--bar' ) ) . to . be . true ;
49
+ }
37
50
38
51
set . clear ( ) ;
39
52
expect ( el . hasAttribute ( 'state--foo' ) ) . to . be . false ;
40
53
expect ( el . hasAttribute ( 'state--bar' ) ) . to . be . false ;
54
+ if ( el . part ) {
55
+ expect ( el . part . contains ( 'state--foo' ) ) . to . be . false ;
56
+ expect ( el . part . contains ( 'state--bar' ) ) . to . be . false ;
57
+ }
41
58
} ) ;
42
59
} ) ;
0 commit comments