Skip to content

Commit ab2d7d8

Browse files
JuliRossiclaude
andcommitted
fix(drive-integration): rename Back to Cancel in AddEntryForm — it is a cancel action, not step navigation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4be4c73 commit ab2d7d8

2 files changed

Lines changed: 8 additions & 16 deletions

File tree

apps/drive-integration/src/locations/Page/components/review/mapping/edit-modals/EditModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ export const EditModal = ({
348348
{showAddEntryForm ? (
349349
<>
350350
<Button onClick={() => setAddEntryFormState(null)} size="small" variant="secondary">
351-
Back
351+
Cancel
352352
</Button>
353353
<Button
354354
onClick={handleAddEntrySave}

apps/drive-integration/test/locations/Page/components/modals/EditModal.spec.tsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)