diff --git a/app/containers/Applications/ApplyButtonContainer.tsx b/app/containers/Applications/ApplyButtonContainer.tsx index 5112dcf197..f2d7b9d39d 100644 --- a/app/containers/Applications/ApplyButtonContainer.tsx +++ b/app/containers/Applications/ApplyButtonContainer.tsx @@ -53,11 +53,7 @@ export const ApplyButton: React.FunctionComponent = ({ ]); if (!canOpenApplication) { - return ( - - ); + return null; } if (!applicationId) { diff --git a/app/tests/unit/containers/Applications/ApplyButtonContainer.test.tsx b/app/tests/unit/containers/Applications/ApplyButtonContainer.test.tsx index 2d4592f220..c0becef9ea 100644 --- a/app/tests/unit/containers/Applications/ApplyButtonContainer.test.tsx +++ b/app/tests/unit/containers/Applications/ApplyButtonContainer.test.tsx @@ -63,7 +63,7 @@ describe('The apply button', () => { ); }); - it('should render a disabled button if no applicationByApplicationId exists and the application window is closed', () => { + it('should not render anything if no applicationByApplicationId exists and the application window is closed', () => { const r = shallow( { /> ); - expect(r).toMatchSnapshot(); - expect(r.exists('Button')).toBe(true); - expect(r.find('Button').prop('disabled')).toBe(true); - expect(r.find('Button').text()).toBe('The application window is closed'); + expect(r).toEqual({}); }); - it('should render a disabled button if no applicationByApplicationId exists and query.openedReportingYear.reportingYear !== reportingYear', () => { + it('should not render anything if no applicationByApplicationId exists and query.openedReportingYear.reportingYear !== reportingYear', () => { const r = shallow( { /> ); - expect(r).toMatchSnapshot(); - expect(r.exists('Button')).toBe(true); - expect(r.find('Button').prop('disabled')).toBe(true); - expect(r.find('Button').text()).toBe('The application window is closed'); + expect(r).toEqual({}); }); it('should render a Resume Application button if an application revision exists with draft status and the application window is open', () => { @@ -155,7 +149,7 @@ describe('The apply button', () => { expect(r.find('Button').text()).toBe('Resume CIIP application'); }); - it('should render a disabled button if an application revision exists with draft status, its versionNumber is 1, and the application window is closed', () => { + it('should not render anything if an application revision exists with draft status, its versionNumber is 1, and the application window is closed', () => { const r = shallow( { /> ); - expect(r).toMatchSnapshot(); - expect(r.exists('Button')).toBe(true); - expect(r.find('Button').prop('disabled')).toBe(true); - expect(r.find('Button').text()).toBe('The application window is closed'); + expect(r).toEqual({}); }); - it('should render a disabled button if an application revision exists with draft status, its versionNumber is > 1, and the application window is closed', () => { + it('should not render anything if an application revision exists with draft status, its versionNumber is > 1, and the application window is closed', () => { const r = shallow( { /> ); - expect(r).toMatchSnapshot(); - expect(r.exists('Button')).toBe(true); - expect(r.find('Button').text()).toBe('Resume CIIP application'); + expect(r).toEqual({}); }); it('should render a View Application button if an application revision exists with submitted status', () => { diff --git a/app/tests/unit/containers/Applications/__snapshots__/ApplyButtonContainer.test.tsx.snap b/app/tests/unit/containers/Applications/__snapshots__/ApplyButtonContainer.test.tsx.snap index 0aa59ee429..799e761a00 100644 --- a/app/tests/unit/containers/Applications/__snapshots__/ApplyButtonContainer.test.tsx.snap +++ b/app/tests/unit/containers/Applications/__snapshots__/ApplyButtonContainer.test.tsx.snap @@ -104,51 +104,6 @@ exports[`The apply button should render a View Application button if an applicat `; -exports[`The apply button should render a disabled button if an application revision exists with draft status, its versionNumber is > 1, and the application window is closed 1`] = ` - -`; - -exports[`The apply button should render a disabled button if an application revision exists with draft status, its versionNumber is 1, and the application window is closed 1`] = ` - -`; - -exports[`The apply button should render a disabled button if no applicationByApplicationId exists and query.openedReportingYear.reportingYear !== reportingYear 1`] = ` - -`; - -exports[`The apply button should render a disabled button if no applicationByApplicationId exists and the application window is closed 1`] = ` - -`; - exports[`The apply button should render a warning modal if no swrs report exists 1`] = `