diff --git a/app/src/organisms/FirmwareUpdateModal/__tests__/FirmwareUpdateModal.test.tsx b/app/src/organisms/FirmwareUpdateModal/__tests__/FirmwareUpdateModal.test.tsx index 4ef3942e413..6c49288b30e 100644 --- a/app/src/organisms/FirmwareUpdateModal/__tests__/FirmwareUpdateModal.test.tsx +++ b/app/src/organisms/FirmwareUpdateModal/__tests__/FirmwareUpdateModal.test.tsx @@ -119,12 +119,13 @@ describe('FirmwareUpdateModal', () => { vi.advanceTimersByTime(3000) }) screen.getByText('Firmware is up to date.') + screen.getByLabelText('check') act(() => { vi.advanceTimersByTime(3000) }) await waitFor(() => expect(props.proceed).toHaveBeenCalled()) }) - it('does not render text or a progress bar until instrument update status is known', () => { + it('does not render text until instrument update status is known', () => { vi.mocked(useSubsystemUpdateQuery).mockReturnValue({ data: { data: { @@ -159,6 +160,7 @@ describe('FirmwareUpdateModal', () => { vi.advanceTimersByTime(3000) }) screen.getByText('A firmware update is required, instrument is updating') + screen.getByLabelText('spinner') expect(updateSubsystem).toHaveBeenCalled() }) it('calls refetch instruments and then proceed once update is complete', async () => { diff --git a/app/src/organisms/FirmwareUpdateModal/index.tsx b/app/src/organisms/FirmwareUpdateModal/index.tsx index eedad934eb9..f669b871445 100644 --- a/app/src/organisms/FirmwareUpdateModal/index.tsx +++ b/app/src/organisms/FirmwareUpdateModal/index.tsx @@ -74,7 +74,7 @@ export const FirmwareUpdateModal = ( isOnDevice, } = props const [updateId, setUpdateId] = React.useState(null) - const [firmwareText, setFirmwareText] = React.useState('') + const [firmwareText, setFirmwareText] = React.useState(null) const { data: attachedInstruments, refetch: refetchInstruments, @@ -132,17 +132,26 @@ export const FirmwareUpdateModal = ( return ( - {status != null || updateNeeded || firmwareText.length === 0 ? ( + {status != null || updateNeeded || !firmwareText ? ( - ) : null} + ) : ( + + )} - {firmwareText.length ? firmwareText : 'Checking for updates...'} + {firmwareText ?? 'Checking for updates...'} )