From 6bcdfd4c12673625410c653a405e8839f08dd169 Mon Sep 17 00:00:00 2001 From: asuresh-code <69875854+asuresh-code@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:17:11 +0000 Subject: [PATCH] Apply suggestions from code review Commit PR Review Suggestions. Co-authored-by: rowan04 Co-authored-by: Joshua Kitenge <83226114+joshuadkitenge@users.noreply.github.com> --- cypress/e2e/with_mock_data/items.cy.ts | 4 ++-- src/common/editFileDialog.component.test.tsx | 6 +++--- src/common/editFileDialog.component.tsx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/with_mock_data/items.cy.ts b/cypress/e2e/with_mock_data/items.cy.ts index e720a69fb..b7c8a214c 100644 --- a/cypress/e2e/with_mock_data/items.cy.ts +++ b/cypress/e2e/with_mock_data/items.cy.ts @@ -935,7 +935,7 @@ describe('Items', () => { }); }); - it('not changing any fields shows error', () => { + it('shows error when no fields have been changed', () => { cy.findByText('5YUQDDjKpz2z').click(); cy.findByText( 'High-resolution cameras for beam characterization. 1' @@ -957,7 +957,7 @@ describe('Items', () => { cy.findByRole('button', { name: 'Save' }).should('be.disabled'); }); - it('Required fields that are cleared are not allowed and show error message', () => { + it('shows error message when required fields are cleared', () => { cy.findByText('5YUQDDjKpz2z').click(); cy.findByText( 'High-resolution cameras for beam characterization. 1' diff --git a/src/common/editFileDialog.component.test.tsx b/src/common/editFileDialog.component.test.tsx index f909230c5..abe94d589 100644 --- a/src/common/editFileDialog.component.test.tsx +++ b/src/common/editFileDialog.component.test.tsx @@ -106,7 +106,7 @@ describe('Edit file dialog', () => { expect(onClose).toHaveBeenCalled(); }); - it('No values changed shows correct error message', async () => { + it('shows correct error message when no values are changed', async () => { createView(); const saveButton = screen.getByRole('button', { name: 'Save' }); @@ -120,7 +120,7 @@ describe('Edit file dialog', () => { ).toBeInTheDocument(); }); - it('Required fields show error if they are whitespace or current value just removed', async () => { + it('shows error message if required fields are whitespace or their current value was removed', async () => { createView(); modifyFileValues({ file_name: '', @@ -133,7 +133,7 @@ describe('Edit file dialog', () => { expect(onClose).not.toHaveBeenCalled(); }); - it('CatchAllError request works correctly and displays refresh page message', async () => { + it('displays refresh page message and a CatchAllError request works correctly', async () => { createView(); modifyFileValues({ file_name: 'Error 500', diff --git a/src/common/editFileDialog.component.tsx b/src/common/editFileDialog.component.tsx index 747b1e3fb..3eba5fc8d 100644 --- a/src/common/editFileDialog.component.tsx +++ b/src/common/editFileDialog.component.tsx @@ -134,7 +134,7 @@ const EditFileDialog = (props: FileDialogProps) => { ); return ( - + {`Edit ${fileType}`}