@@ -4,6 +4,7 @@ import { AlertBlock } from './template'
44import { AlertBlock as FormattedAlertBlock } from '@/components/alert/formatted-type'
55import { ExpandableText } from '@/components/expandableText/formatted-type'
66import { Wysiwyg } from '@/components/wysiwyg/formatted-type'
7+ import { ParagraphRendererProvider } from '@/components/paragraph/ParagraphRendererProvider'
78
89const expandableText : ExpandableText = {
910 id : 'et-1' ,
@@ -31,8 +32,15 @@ describe('<Alert> with valid data and with expandable text', () => {
3132 content : expandableText ,
3233 }
3334
35+ const renderAlertBlock = ( props : FormattedAlertBlock ) =>
36+ render (
37+ < ParagraphRendererProvider >
38+ < AlertBlock { ...props } />
39+ </ ParagraphRendererProvider >
40+ )
41+
3442 test ( 'renders info <Alert> component' , async ( ) => {
35- const { container } = render ( < AlertBlock { ... blockContentExpandable } /> )
43+ const { container } = renderAlertBlock ( blockContentExpandable )
3644
3745 const vaAdditionalInfo = container . querySelector ( 'va-additional-info' )
3846 expect ( vaAdditionalInfo ) . toHaveAttribute ( 'trigger' , 'Learn how to sign in' )
@@ -53,7 +61,7 @@ describe('<Alert> with valid data and with expandable text', () => {
5361
5462 test ( 'renders warning <Alert> component' , async ( ) => {
5563 blockContentExpandable . alertType = 'warning'
56- const { container } = render ( < AlertBlock { ... blockContentExpandable } /> )
64+ const { container } = renderAlertBlock ( blockContentExpandable )
5765
5866 const vaAdditionalInfo = container . querySelector ( 'va-additional-info' )
5967 expect ( vaAdditionalInfo ) . toHaveAttribute ( 'trigger' , 'Learn how to sign in' )
@@ -79,8 +87,15 @@ describe('<Alert> with valid data and wysiwyg', () => {
7987 content : wysiwyg ,
8088 }
8189
90+ const renderAlertBlock = ( props : FormattedAlertBlock ) =>
91+ render (
92+ < ParagraphRendererProvider >
93+ < AlertBlock { ...props } />
94+ </ ParagraphRendererProvider >
95+ )
96+
8297 test ( 'renders info <Alert> component' , async ( ) => {
83- const { container } = render ( < AlertBlock { ... blockContentWysiwyg } /> )
98+ const { container } = renderAlertBlock ( blockContentWysiwyg )
8499
85100 expect (
86101 container . querySelector ( 'va-additional-info' )
@@ -99,7 +114,7 @@ describe('<Alert> with valid data and wysiwyg', () => {
99114
100115 test ( 'renders warning <Alert> component' , async ( ) => {
101116 blockContentWysiwyg . alertType = 'warning'
102- const { container } = render ( < AlertBlock { ... blockContentWysiwyg } /> )
117+ const { container } = renderAlertBlock ( blockContentWysiwyg )
103118
104119 expect (
105120 container . querySelector ( 'va-additional-info' )
0 commit comments