Skip to content

Commit

Permalink
fix tests, update CSV required check
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdiehl11 committed Jun 26, 2024
1 parent c797e53 commit 98324ca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions app/src/organisms/ChooseProtocolSlideout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,7 @@ function StoredProtocolList(props: StoredProtocolListProps): JSX.Element {
const missingAnalysisData =
analysisStatus === 'error' || analysisStatus === 'stale'
const requiresCsvRunTimeParameter =
storedProtocol.mostRecentAnalysis?.result ===
'parameter-value-required'
analysisStatus === 'parameterRequired'
return (
<React.Fragment key={storedProtocol.protocolKey}>
<Flex flexDirection={DIRECTION_COLUMN}>
Expand Down Expand Up @@ -829,7 +828,7 @@ function StoredProtocolList(props: StoredProtocolListProps): JSX.Element {
color={COLORS.yellow60}
overflowWrap="anywhere"
display={DISPLAY_BLOCK}
marginTop={`-${SPACING.spacing8}`}
marginTop={`-${SPACING.spacing4}`}
marginBottom={SPACING.spacing8}
>
{t('csv_required_for_analysis')}
Expand All @@ -841,7 +840,7 @@ function StoredProtocolList(props: StoredProtocolListProps): JSX.Element {
color={COLORS.yellow60}
overflowWrap="anywhere"
display={DISPLAY_BLOCK}
marginTop={`-${SPACING.spacing8}`}
marginTop={`-${SPACING.spacing4}`}
marginBottom={SPACING.spacing8}
>
{analysisStatus === 'stale'
Expand Down
2 changes: 1 addition & 1 deletion app/src/organisms/ChooseRobotSlideout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export function ChooseRobotSlideout(
color={COLORS.red60}
overflowWrap={OVERFLOW_WRAP_ANYWHERE}
display={DISPLAY_INLINE_BLOCK}
marginTop={`-${SPACING.spacing8}`}
marginTop={`-${SPACING.spacing4}`}
marginBottom={SPACING.spacing8}
>
{runCreationErrorCode === 409 ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export function ChooseRobotToRunProtocolSlideoutComponent(
createRunFromProtocolSource({
files: srcFileObjects,
protocolKey,
runTimeParameterValues: runTimeParameterValuesWithFiles,
runTimeParameterValues, // : runTimeParameterValuesWithFiles,
})
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@ describe('useUploadCsvFileMutation', () => {
wrapper,
})
expect(result.current.data).toBeUndefined()
result.current.uploadCsvFile(mockFilePath)
result.current.uploadCsvFile(mockFilePath).catch(_ => {})
await waitFor(() => {
expect(result.current.data).toBeUndefined()
expect(result.current.error).toBe('oh no')
})
})

it.skip('should return data when calling uploadCsvFile successfully', async () => {
it('should return data when calling uploadCsvFile successfully', async () => {
vi.mocked(useHost).mockReturnValue(HOST_CONFIG)
vi.mocked(uploadCsvFile).mockResolvedValue({
data: mockUploadResponse,
} as Response<UploadedCsvFileResponse>)

const { result } = renderHook(() => useUploadCsvFileMutation(), { wrapper })
act(() => result.current.uploadCsvFile(mockFilePath))
await act(async () => result.current.uploadCsvFile(mockFilePath))

Check failure on line 72 in react-api-client/src/dataFiles/__tests__/useUploadCsvFileMutation.test.tsx

View workflow job for this annotation

GitHub Actions / js checks

Returning an awaited promise is required in this context

Check failure on line 72 in react-api-client/src/dataFiles/__tests__/useUploadCsvFileMutation.test.tsx

View workflow job for this annotation

GitHub Actions / js checks

Returning an awaited promise is required in this context

await waitFor(() => {
expect(result.current.data).toEqual(mockUploadResponse)
Expand Down

0 comments on commit 98324ca

Please sign in to comment.