alert titles can render jsx
Signed-off-by: Ryan Vazquez <ryanv@spotify.com>
This commit is contained in:
@@ -41,8 +41,8 @@ describe('<AlertInsightsSection/>', () => {
|
||||
onAccept={jest.fn()}
|
||||
/>,
|
||||
);
|
||||
expect(getByText(mockAlert.title)).toBeInTheDocument();
|
||||
expect(getByText(mockAlert.subtitle)).toBeInTheDocument();
|
||||
expect(getByText(mockAlert.title as string)).toBeInTheDocument();
|
||||
expect(getByText(mockAlert.subtitle as string)).toBeInTheDocument();
|
||||
expect(getByText('View Instructions')).toBeInTheDocument();
|
||||
expect(queryByText('Snooze')).not.toBeInTheDocument();
|
||||
expect(queryByText('Accept')).not.toBeInTheDocument();
|
||||
|
||||
@@ -50,8 +50,8 @@ describe('<AlertStatusSummary />', () => {
|
||||
</MockScrollProvider>,
|
||||
);
|
||||
[mockSnoozed, mockAccepted, mockDismissed].forEach(a => {
|
||||
expect(getByText(a.title)).toBeInTheDocument();
|
||||
expect(getByText(a.subtitle)).toBeInTheDocument();
|
||||
expect(getByText(a.title as string)).toBeInTheDocument();
|
||||
expect(getByText(a.subtitle as string)).toBeInTheDocument();
|
||||
expect(getByRole('img', { name: a.status })).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -34,8 +34,8 @@ import { Maybe } from './Maybe';
|
||||
*/
|
||||
|
||||
export type Alert = {
|
||||
title: string;
|
||||
subtitle: string;
|
||||
title: string | JSX.Element;
|
||||
subtitle: string | JSX.Element;
|
||||
element?: JSX.Element;
|
||||
status?: AlertStatus;
|
||||
url?: string;
|
||||
|
||||
Reference in New Issue
Block a user