Skip to content

Commit bd534b2

Browse files
1012Charanskoeva
andcommitted
frontend: cluster: Add Overview stories
Co-authored-by: Evangelos Skopelitis <eskopelitis@microsoft.com> Co-authored-by: 1012Charan <charanvengala@gmail.com>
1 parent c8fdeae commit bd534b2

File tree

4 files changed

+2144
-0
lines changed

4 files changed

+2144
-0
lines changed

frontend/src/components/cluster/Overview.stories.tsx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,53 @@ const Template: StoryFn = () => {
192192
};
193193

194194
export 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+
storyshots: { disable: true },
224+
msw: {
225+
handlers: {
226+
story: [
227+
http.get('http://localhost:4466/api/v1/events', () => new Promise(() => {})),
228+
http.get('http://localhost:4466/api/v1/pods', () => new Promise(() => {})),
229+
],
230+
},
231+
},
232+
};
233+
234+
export const ErrorState = Template.bind({});
235+
ErrorState.parameters = {
236+
msw: {
237+
handlers: {
238+
story: [
239+
http.get('http://localhost:4466/api/v1/events', () => HttpResponse.error()),
240+
http.get('http://localhost:4466/api/v1/pods', () => HttpResponse.error()),
241+
],
242+
},
243+
},
244+
};

0 commit comments

Comments
 (0)