@@ -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' , ( ) => {
@@ -1615,3 +1617,35 @@ describe('BannerStruct', () => {
16151617 expect ( is ( value , BannerStruct ) ) . toBe ( false ) ;
16161618 } ) ;
16171619} ) ;
1620+
1621+ describe ( 'SkeletonStruct' , ( ) => {
1622+ it . each ( [
1623+ < Skeleton width = { 320 } height = { 32 } /> ,
1624+ < Skeleton width = "30%" height = "30%" /> ,
1625+ < Skeleton width = { 32 } height = "30%" /> ,
1626+ < Skeleton width = "30%" height = { 32 } /> ,
1627+ < Skeleton width = "30%" height = { 32 } borderRadius = "full" /> ,
1628+ < Skeleton width = { 32 } height = "30%" borderRadius = "medium" /> ,
1629+ ] ) ( `validates a Skeleton element` , ( value ) => {
1630+ expect ( is ( value , SkeletonStruct ) ) . toBe ( true ) ;
1631+ } ) ;
1632+
1633+ it . each ( [
1634+ 'foo' ,
1635+ 42 ,
1636+ null ,
1637+ undefined ,
1638+ { } ,
1639+ [ ] ,
1640+ // @ts -expect-error - Invalid props.
1641+ < Skeleton /> ,
1642+ // @ts -expect-error - Invalid props.
1643+ < Skeleton foo = "bar" > foo</ Skeleton > ,
1644+ // @ts -expect-error - Invalid props.
1645+ < Skeleton title = { < Copyable value = "bar" /> } severity = "info" >
1646+ < Text > foo</ Text >
1647+ </ Skeleton > ,
1648+ ] ) ( 'does not validate "%p"' , ( value ) => {
1649+ expect ( is ( value , SkeletonStruct ) ) . toBe ( false ) ;
1650+ } ) ;
1651+ } ) ;
0 commit comments