@@ -185,12 +185,10 @@ describe('EditModal', () => {
185185 await openAddEntryForm ( ) ;
186186
187187 expect ( screen . getByText ( 'Select content type' ) ) . toBeTruthy ( ) ;
188- expect ( screen . getByRole ( 'button' , { name : 'Back ' } ) ) . toBeTruthy ( ) ;
188+ expect ( screen . getByRole ( 'button' , { name : 'Cancel ' } ) ) . toBeTruthy ( ) ;
189189 expect ( screen . getByRole ( 'button' , { name : 'Save' } ) ) . toBeDisabled ( ) ;
190190 expect ( screen . queryByRole ( 'button' , { name : 'Next' } ) ) . toBeNull ( ) ;
191- expect (
192- screen . queryByText ( 'Should this new entry be a reference of an existing entry?' )
193- ) . toBeNull ( ) ;
191+ expect ( screen . queryByText ( 'Should this entry be a reference entry?' ) ) . toBeNull ( ) ;
194192 } ) ;
195193
196194 it ( 'shows radios and field multiselect together after content type is selected' , async ( ) => {
@@ -199,17 +197,13 @@ describe('EditModal', () => {
199197 fireEvent . change ( screen . getByRole ( 'combobox' ) , { target : { value : 'page' } } ) ;
200198
201199 await waitFor ( ( ) => {
202- expect (
203- screen . getByText ( 'Should this new entry be a reference of an existing entry?' )
204- ) . toBeTruthy ( ) ;
200+ expect ( screen . getByText ( 'Should this entry be a reference entry?' ) ) . toBeTruthy ( ) ;
205201 expect ( screen . getByLabelText ( 'Yes' ) ) . toBeTruthy ( ) ;
206202 expect ( screen . getByLabelText ( 'No' ) ) . toBeTruthy ( ) ;
207203 expect ( screen . getByText ( 'Select the field(s) the content should map to' ) ) . toBeTruthy ( ) ;
208204 } ) ;
209205
210- expect (
211- screen . queryByText ( 'Which existing entry should this new entry be a reference to?' )
212- ) . toBeNull ( ) ;
206+ expect ( screen . queryByText ( 'Select the entry this should reference' ) ) . toBeNull ( ) ;
213207 } ) ;
214208
215209 it ( 'shows parent entry select when Yes is chosen' , async ( ) => {
@@ -224,9 +218,7 @@ describe('EditModal', () => {
224218 fireEvent . click ( screen . getByLabelText ( 'Yes' ) ) ;
225219
226220 await waitFor ( ( ) => {
227- expect (
228- screen . getByText ( 'Which existing entry should this new entry be a reference to?' )
229- ) . toBeTruthy ( ) ;
221+ expect ( screen . getByText ( 'Select the entry this should reference' ) ) . toBeTruthy ( ) ;
230222 expect ( screen . getByText ( 'Blog post' ) ) . toBeTruthy ( ) ;
231223 } ) ;
232224 } ) ;
@@ -269,10 +261,10 @@ describe('EditModal', () => {
269261 } ) ;
270262 } ) ;
271263
272- it ( 'exits the form when Back is clicked' , async ( ) => {
264+ it ( 'cancels the form and returns to the modal when Cancel is clicked' , async ( ) => {
273265 await openAddEntryForm ( ) ;
274266
275- fireEvent . click ( screen . getByRole ( 'button' , { name : 'Back ' } ) ) ;
267+ fireEvent . click ( screen . getByRole ( 'button' , { name : 'Cancel ' } ) ) ;
276268
277269 await waitFor ( ( ) => {
278270 expect ( screen . getByText ( 'New location' ) ) . toBeTruthy ( ) ;
0 commit comments