Skip to content

Commit 706b9d9

Browse files
committed
fix(reliability-inbox): keep entry point visible without checks
1 parent 8e2dcf0 commit 706b9d9

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
import { screen } from '@testing-library/react';
3+
import { render } from 'test/render';
4+
5+
import { SummaryDashboard } from './SummaryDashboard';
6+
7+
jest.mock('features/reliabilityInbox', () => {
8+
const React = jest.requireActual('react');
9+
10+
return {
11+
ReliabilityInboxBanner: () => React.createElement('div', { 'data-testid': 'reliability-inbox-banner' }),
12+
};
13+
});
14+
15+
jest.mock('hooks/useMetricsDS', () => ({
16+
useMetricsDS: () => undefined,
17+
}));
18+
19+
describe('SummaryDashboard', () => {
20+
it('keeps Reliability Inbox and manual creation available when the unfiltered check inventory is empty', async () => {
21+
render(<SummaryDashboard checks={[]} />);
22+
23+
expect(await screen.findByTestId('reliability-inbox-banner')).toBeInTheDocument();
24+
expect(await screen.findByText("You haven't created any checks yet")).toBeInTheDocument();
25+
expect(await screen.findByText('Create new check')).toBeInTheDocument();
26+
});
27+
});

src/scenes/Summary/SummaryDashboard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ export const SummaryDashboard = ({ checks }: SummaryDashboardProps) => {
131131
const styles = useStyles2(getStyles);
132132

133133
if (checks.length === 0) {
134-
return <ChecksEmptyState className={styles.emptyState} />;
134+
return (
135+
<Stack direction="column" gap={1}>
136+
<ReliabilityInboxBanner />
137+
<ChecksEmptyState className={styles.emptyState} />
138+
</Stack>
139+
);
135140
}
136141

137142
return (

0 commit comments

Comments
 (0)