@@ -43,4 +43,22 @@ describe('<ActionItemCard/>', () => {
|
||||
expect(rendered.getByText(alert.title)).toBeInTheDocument();
|
||||
expect(rendered.getByText(alert.subtitle)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders custom title elements', async () => {
|
||||
const rendered = await renderInTestApp(
|
||||
<MockScrollProvider>
|
||||
<ActionItemCard
|
||||
alert={{
|
||||
...alert,
|
||||
title: <span>Foo</span>,
|
||||
subtitle: <span>Bar</span>,
|
||||
}}
|
||||
avatar={<div>1</div>}
|
||||
/>
|
||||
</MockScrollProvider>,
|
||||
);
|
||||
|
||||
expect(rendered.getByText('Foo')).toBeInTheDocument();
|
||||
expect(rendered.getByText('Bar')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -49,6 +49,25 @@ describe('<AlertInsightsSection/>', () => {
|
||||
expect(queryByText('Dismiss')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders custom title elements', () => {
|
||||
const { getByText } = renderInContext(
|
||||
<AlertInsightsSection
|
||||
alert={{
|
||||
...mockAlert,
|
||||
title: <span>Foo</span>,
|
||||
subtitle: <span>Bar</span>,
|
||||
}}
|
||||
number={1}
|
||||
onSnooze={jest.fn()}
|
||||
onDismiss={jest.fn()}
|
||||
onAccept={jest.fn()}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(getByText('Foo')).toBeInTheDocument();
|
||||
expect(getByText('Bar')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('Hides instructions button if url is not provided', () => {
|
||||
const alert: Alert = {
|
||||
...mockAlert,
|
||||
|
||||
Reference in New Issue
Block a user