@@ -12,6 +12,7 @@ import {
1212 assertSignOutLink ,
1313 assertSkipToMainContent ,
1414} from 'helpers/template-mgmt-common.steps' ;
15+ import { RoutingMessagePlansPage } from 'pages/routing/message-plans-page' ;
1516import { RoutingMoveToProductionPage } from 'pages/routing/move-to-production-page' ;
1617
1718const storageHelper = new RoutingConfigStorageHelper ( ) ;
@@ -53,7 +54,7 @@ test.describe('Create Message Plan Page', () => {
5354 const routingConfig =
5455 RoutingConfigFactory . create ( user ) . withTemplates ( 'NHSAPP' ) ;
5556
56- storageHelper . seed ( [ routingConfig . dbEntry ] ) ;
57+ await storageHelper . seed ( [ routingConfig . dbEntry ] ) ;
5758
5859 const moveToProductionPage = new RoutingMoveToProductionPage ( page ) ;
5960
@@ -66,7 +67,21 @@ test.describe('Create Message Plan Page', () => {
6667 await moveToProductionPage . submitButton . click ( ) ;
6768
6869 await expect ( page ) . toHaveURL ( `${ baseURL } /templates/message-plans` ) ;
69- // TODO: CCM-11496 - assert status
70+
71+ const messagePlansPage = new RoutingMessagePlansPage ( page ) ;
72+
73+ await messagePlansPage . productionMessagePlansTable . click ( ) ;
74+
75+ const productionIdCells =
76+ messagePlansPage . productionMessagePlansTable . getByTestId (
77+ 'message-plan-id-cell'
78+ ) ;
79+
80+ const productionCellsText = await productionIdCells . allTextContents ( ) ;
81+
82+ expect ( productionCellsText ) . toContainEqual (
83+ expect . stringContaining ( routingConfig . dbEntry . id )
84+ ) ;
7085 } ) ;
7186
7287 test ( 'links to preview page for the message plan' , async ( {
@@ -76,7 +91,7 @@ test.describe('Create Message Plan Page', () => {
7691 const routingConfig =
7792 RoutingConfigFactory . create ( user ) . withTemplates ( 'NHSAPP' ) ;
7893
79- storageHelper . seed ( [ routingConfig . dbEntry ] ) ;
94+ await storageHelper . seed ( [ routingConfig . dbEntry ] ) ;
8095
8196 const moveToProductionPage = new RoutingMoveToProductionPage ( page ) ;
8297
@@ -93,14 +108,14 @@ test.describe('Create Message Plan Page', () => {
93108 ) ;
94109 } ) ;
95110
96- test ( 'cancel button links to the message plan list page' , async ( {
111+ test ( 'cancel button links to the message plan list page, does not move the plan to production ' , async ( {
97112 baseURL,
98113 page,
99114 } ) => {
100115 const routingConfig =
101116 RoutingConfigFactory . create ( user ) . withTemplates ( 'NHSAPP' ) ;
102117
103- storageHelper . seed ( [ routingConfig . dbEntry ] ) ;
118+ await storageHelper . seed ( [ routingConfig . dbEntry ] ) ;
104119
105120 const moveToProductionPage = new RoutingMoveToProductionPage ( page ) ;
106121
@@ -113,5 +128,19 @@ test.describe('Create Message Plan Page', () => {
113128 await moveToProductionPage . cancelLink . click ( ) ;
114129
115130 await expect ( page ) . toHaveURL ( `${ baseURL } /templates/message-plans` ) ;
131+
132+ const messagePlansPage = new RoutingMessagePlansPage ( page ) ;
133+
134+ await messagePlansPage . draftMessagePlansTable . click ( ) ;
135+
136+ const draftIdCells = messagePlansPage . draftMessagePlansTable . getByTestId (
137+ 'message-plan-id-cell'
138+ ) ;
139+
140+ const draftCellsText = await draftIdCells . allTextContents ( ) ;
141+
142+ expect ( draftCellsText ) . toContainEqual (
143+ expect . stringContaining ( routingConfig . dbEntry . id )
144+ ) ;
116145 } ) ;
117146} ) ;
0 commit comments