@@ -34,6 +34,7 @@ import {
3434 Section ,
3535 Avatar ,
3636 Banner ,
37+ Skeleton ,
3738} from './components' ;
3839import {
3940 AddressStruct ,
@@ -72,6 +73,7 @@ import {
7273 SectionStruct ,
7374 AvatarStruct ,
7475 BannerStruct ,
76+ SkeletonStruct ,
7577} from './validation' ;
7678
7779describe ( 'KeyStruct' , ( ) => {
@@ -1618,3 +1620,35 @@ describe('BannerStruct', () => {
16181620 expect ( is ( value , BannerStruct ) ) . toBe ( false ) ;
16191621 } ) ;
16201622} ) ;
1623+
1624+ describe ( 'SkeletonStruct' , ( ) => {
1625+ it . each ( [
1626+ < Skeleton width = { 320 } height = { 32 } /> ,
1627+ < Skeleton width = "30%" height = "30%" /> ,
1628+ < Skeleton width = { 32 } height = "30%" /> ,
1629+ < Skeleton width = "30%" height = { 32 } /> ,
1630+ < Skeleton width = "30%" height = { 32 } borderRadius = "full" /> ,
1631+ < Skeleton width = { 32 } height = "30%" borderRadius = "medium" /> ,
1632+ ] ) ( `validates a Skeleton element` , ( value ) => {
1633+ expect ( is ( value , SkeletonStruct ) ) . toBe ( true ) ;
1634+ } ) ;
1635+
1636+ it . each ( [
1637+ 'foo' ,
1638+ 42 ,
1639+ null ,
1640+ undefined ,
1641+ { } ,
1642+ [ ] ,
1643+ // @ts -expect-error - Invalid props.
1644+ < Skeleton /> ,
1645+ // @ts -expect-error - Invalid props.
1646+ < Skeleton foo = "bar" > foo</ Skeleton > ,
1647+ // @ts -expect-error - Invalid props.
1648+ < Skeleton title = { < Copyable value = "bar" /> } severity = "info" >
1649+ < Text > foo</ Text >
1650+ </ Skeleton > ,
1651+ ] ) ( 'does not validate "%p"' , ( value ) => {
1652+ expect ( is ( value , SkeletonStruct ) ) . toBe ( false ) ;
1653+ } ) ;
1654+ } ) ;
0 commit comments