Skip to content

Commit 9317ea9

Browse files
authored
fix(app): Add special casing for Stacker combination fixtures in deck conflict resolution (#18988)
closes RQA-4382, RQA-4319, EXEC-1416
1 parent 3e03128 commit 9317ea9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1339
-890
lines changed
4.81 KB
Loading
5.34 KB
Loading
6.36 KB
Loading
6.01 KB
Loading
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import {
2+
ALIGN_CENTER,
3+
COLORS,
4+
Flex,
5+
JUSTIFY_FLEX_END,
6+
JUSTIFY_SPACE_BETWEEN,
7+
ListItem,
8+
SPACING,
9+
StyledText,
10+
} from '@opentrons/components'
11+
12+
import { SmallButton } from '/app/atoms/buttons'
13+
14+
import type { MouseEventHandler } from 'react'
15+
16+
interface ODDFixtureOptionProps {
17+
onClickHandler: MouseEventHandler
18+
secondaryOnClickHandler?: MouseEventHandler
19+
optionName: string
20+
secondaryButtonText?: string
21+
buttonText: string
22+
}
23+
export function ODDFixtureOption(props: ODDFixtureOptionProps): JSX.Element {
24+
const {
25+
onClickHandler,
26+
optionName,
27+
buttonText,
28+
secondaryOnClickHandler,
29+
secondaryButtonText,
30+
} = props
31+
return (
32+
<ListItem
33+
type="default"
34+
alignItems={ALIGN_CENTER}
35+
justifyContent={JUSTIFY_SPACE_BETWEEN}
36+
backgroundColor={COLORS.grey35}
37+
>
38+
<Flex gridGap={SPACING.spacing24}>
39+
<StyledText oddStyle="bodyTextSemiBold">{optionName}</StyledText>
40+
<Flex gridGap={SPACING.spacing16} justifyContent={JUSTIFY_FLEX_END}>
41+
{secondaryOnClickHandler != null && secondaryButtonText != null ? (
42+
<SmallButton
43+
buttonType="secondary"
44+
onClick={secondaryOnClickHandler}
45+
data-testid={optionName}
46+
buttonText={secondaryButtonText}
47+
buttonCategory="rounded"
48+
/>
49+
) : null}
50+
<SmallButton
51+
onClick={onClickHandler}
52+
data-testid={optionName}
53+
buttonText={buttonText}
54+
buttonCategory="rounded"
55+
/>
56+
</Flex>
57+
</Flex>
58+
</ListItem>
59+
)
60+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { fireEvent, screen } from '@testing-library/react'
2+
import { describe, expect, it, vi } from 'vitest'
3+
4+
import { renderWithProviders } from '/app/__testing-utils__'
5+
6+
import { ODDFixtureOption } from '..'
7+
8+
import type { ComponentProps } from 'react'
9+
10+
const render = (props: ComponentProps<typeof ODDFixtureOption>) => {
11+
return renderWithProviders(<ODDFixtureOption {...props} />)
12+
}
13+
14+
describe('ODDFixtureOption', () => {
15+
let props: ComponentProps<typeof ODDFixtureOption>
16+
17+
it('should render text and buttons for desktop app', () => {
18+
props = {
19+
onClickHandler: vi.fn(),
20+
optionName: 'mockOption',
21+
buttonText: 'mockText',
22+
}
23+
render(props)
24+
screen.getByText('mockOption')
25+
screen.getByText('mockText')
26+
fireEvent.click(screen.getByTestId('mockOption'))
27+
expect(props.onClickHandler).toHaveBeenCalled()
28+
})
29+
it('should render text and buttons for odd', () => {
30+
props = {
31+
onClickHandler: vi.fn(),
32+
optionName: 'mockOption',
33+
buttonText: 'mockText',
34+
}
35+
render(props)
36+
screen.getByText('mockOption')
37+
screen.getByText('mockText')
38+
fireEvent.click(screen.getByRole('button'))
39+
expect(props.onClickHandler).toHaveBeenCalled()
40+
})
41+
})

app/src/organisms/Desktop/Devices/ProtocolRun/SetupModuleAndDeck/NotConfiguredModal.tsx

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)