File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
frontend/src/components/cluster Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -192,3 +192,52 @@ const Template: StoryFn = () => {
192192} ;
193193
194194export const Events = Template . bind ( { } ) ;
195+
196+ export const EmptyState = Template . bind ( { } ) ;
197+ EmptyState . parameters = {
198+ msw : {
199+ handlers : {
200+ story : [
201+ http . get ( 'http://localhost:4466/api/v1/events' , ( ) =>
202+ HttpResponse . json ( {
203+ kind : 'EventsList' ,
204+ items : [ ] ,
205+ metadata : { } ,
206+ } )
207+ ) ,
208+ http . get ( 'http://localhost:4466/api/v1/pods' , ( ) =>
209+ HttpResponse . json ( {
210+ kind : 'PodList' ,
211+ apiVersion : 'v1' ,
212+ metadata : { } ,
213+ items : [ ] ,
214+ } )
215+ ) ,
216+ ] ,
217+ } ,
218+ } ,
219+ } ;
220+
221+ export const LoadingState = Template . bind ( { } ) ;
222+ LoadingState . parameters = {
223+ msw : {
224+ handlers : {
225+ story : [
226+ http . get ( 'http://localhost:4466/api/v1/events' , ( ) => new Promise ( ( ) => { } ) ) , // simulate loading
227+ http . get ( 'http://localhost:4466/api/v1/pods' , ( ) => new Promise ( ( ) => { } ) ) ,
228+ ] ,
229+ } ,
230+ } ,
231+ } ;
232+
233+ export const ErrorState = Template . bind ( { } ) ;
234+ ErrorState . parameters = {
235+ msw : {
236+ handlers : {
237+ story : [
238+ http . get ( 'http://localhost:4466/api/v1/events' , ( ) => HttpResponse . error ( ) ) ,
239+ http . get ( 'http://localhost:4466/api/v1/pods' , ( ) => HttpResponse . error ( ) ) ,
240+ ] ,
241+ } ,
242+ } ,
243+ } ;
You can’t perform that action at this time.
0 commit comments