@@ -24,7 +24,11 @@ describe('MessagePlanBlock', () => {
2424 const channelItem = buildCascadeItem ( 'EMAIL' ) ;
2525
2626 const { container } = render (
27- < MessagePlanBlock index = { 0 } channelItem = { channelItem } />
27+ < MessagePlanBlock
28+ index = { 0 }
29+ channelItem = { channelItem }
30+ routingConfigId = 'test-routing-config-id'
31+ />
2832 ) ;
2933
3034 const stepNumber = container . querySelector ( '.message-plan-block-number' ) ;
@@ -39,7 +43,11 @@ describe('MessagePlanBlock', () => {
3943 const channelItem = buildCascadeItem ( 'NHSAPP' ) ;
4044
4145 const { container } = render (
42- < MessagePlanBlock index = { 2 } channelItem = { channelItem } />
46+ < MessagePlanBlock
47+ index = { 2 }
48+ channelItem = { channelItem }
49+ routingConfigId = 'test-routing-config-id'
50+ />
4351 ) ;
4452
4553 const stepNumber = container . querySelector ( '.message-plan-block-number' ) ;
@@ -52,7 +60,13 @@ describe('MessagePlanBlock', () => {
5260 it ( 'should render the channel template section with the correct channel subheading' , ( ) => {
5361 const channelItem = buildCascadeItem ( 'EMAIL' ) ;
5462
55- render ( < MessagePlanBlock index = { 0 } channelItem = { channelItem } /> ) ;
63+ render (
64+ < MessagePlanBlock
65+ index = { 0 }
66+ channelItem = { channelItem }
67+ routingConfigId = 'test-routing-config-id'
68+ />
69+ ) ;
5670
5771 expect (
5872 screen . getByRole ( 'heading' , { level : 3 , name : 'Email' } )
@@ -68,6 +82,7 @@ describe('MessagePlanBlock', () => {
6882 index = { 0 }
6983 channelItem = { channelItem }
7084 template = { mockTemplate }
85+ routingConfigId = 'test-routing-config-id'
7186 />
7287 ) ;
7388 expect ( screen . getByText ( 'Test email template' ) ) . toBeInTheDocument ( ) ;
@@ -81,14 +96,15 @@ describe('MessagePlanBlock', () => {
8196 index = { 0 }
8297 channelItem = { channelItem }
8398 template = { mockTemplate }
99+ routingConfigId = 'test-routing-config-id'
84100 />
85101 ) ;
86102
87103 expect (
88104 screen . getByRole ( 'link' , { name : 'Change Email template' } )
89105 ) . toBeInTheDocument ( ) ;
90106 expect (
91- screen . getByRole ( 'link ' , { name : 'Remove Email template' } )
107+ screen . getByRole ( 'button ' , { name : 'Remove Email template' } )
92108 ) . toBeInTheDocument ( ) ;
93109 expect (
94110 screen . queryByRole ( 'link' , { name : 'Choose Email template' } )
@@ -100,7 +116,13 @@ describe('MessagePlanBlock', () => {
100116 it ( 'should show Choose link (and no Change/Remove links)' , ( ) => {
101117 const channelItem = buildCascadeItem ( 'SMS' ) ;
102118
103- render ( < MessagePlanBlock index = { 0 } channelItem = { channelItem } /> ) ;
119+ render (
120+ < MessagePlanBlock
121+ index = { 0 }
122+ channelItem = { channelItem }
123+ routingConfigId = 'test-routing-config-id'
124+ />
125+ ) ;
104126
105127 expect (
106128 screen . getByRole ( 'link' , { name : 'Choose Text message (SMS) template' } )
@@ -128,6 +150,7 @@ describe('MessagePlanBlock', () => {
128150 index = { 0 }
129151 channelItem = { channelItem }
130152 template = { mockTemplate }
153+ routingConfigId = 'test-routing-config-id'
131154 />
132155 ) ;
133156 expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
@@ -141,7 +164,11 @@ describe('MessagePlanBlock', () => {
141164 it ( 'should match snapshot' , async ( ) => {
142165 const channelItem = buildCascadeItem ( channel ) ;
143166 const { asFragment } = render (
144- < MessagePlanBlock index = { 0 } channelItem = { channelItem } />
167+ < MessagePlanBlock
168+ index = { 0 }
169+ channelItem = { channelItem }
170+ routingConfigId = 'test-routing-config-id'
171+ />
145172 ) ;
146173 expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
147174 } ) ;
0 commit comments