@@ -65,8 +65,8 @@ describe('Args can be provided in multiple ways', () => {
65
65
it ( '❌ The combined shape of meta args and story args must match the required args.' , ( ) => {
66
66
{
67
67
const meta = preview . meta ( { component : Button } ) ;
68
+ // @ts -expect-error disabled not provided ❌
68
69
const Basic = meta . story ( {
69
- // @ts -expect-error disabled not provided ❌
70
70
args : { label : 'good' } ,
71
71
} ) ;
72
72
}
@@ -80,12 +80,37 @@ describe('Args can be provided in multiple ways', () => {
80
80
}
81
81
{
82
82
const meta = preview . meta ( { component : Button } ) ;
83
+ // @ts -expect-error disabled not provided ❌
83
84
const Basic = meta . story ( {
84
- // @ts -expect-error disabled not provided ❌
85
85
args : { label : 'good' } ,
86
86
} ) ;
87
87
}
88
88
} ) ;
89
+
90
+ it ( "✅ Required args don't need to be provided when the user uses an empty render" , ( ) => {
91
+ const meta = preview . meta ( {
92
+ component : Button ,
93
+ args : { label : 'good' } ,
94
+ } ) ;
95
+ const Basic = meta . story ( {
96
+ args : { } ,
97
+ render : ( ) => < div > Hello world</ div > ,
98
+ } ) ;
99
+ } ) ;
100
+
101
+ it ( '❌ Required args need to be provided when the user uses a non-empty render' , ( ) => {
102
+ const meta = preview . meta ( {
103
+ component : Button ,
104
+ args : { label : 'good' } ,
105
+ } ) ;
106
+ // @ts -expect-error disabled not provided ❌
107
+ const Basic = meta . story ( {
108
+ args : {
109
+ label : 'good' ,
110
+ } ,
111
+ render : ( args ) => < div > Hello world</ div > ,
112
+ } ) ;
113
+ } ) ;
89
114
} ) ;
90
115
91
116
it ( '✅ Void functions are not changed' , ( ) => {
0 commit comments