Skip to content

Commit 0ceaefd

Browse files
chore(app): change default labware view to map (#17422)
1 parent f16f6a0 commit 0ceaefd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__tests__/ProtocolSetupLabware.test.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ describe('ProtocolSetupLabware', () => {
101101

102102
it('renders the Labware Setup page', () => {
103103
render()
104+
fireEvent.click(screen.getByRole('button', { name: 'List View' }))
104105
screen.getByText('Labware')
105106
screen.getByText('Labware name')
106107
screen.getByText('Location')
@@ -115,9 +116,10 @@ describe('ProtocolSetupLabware', () => {
115116

116117
it('should toggle between map view and list view', () => {
117118
render()
119+
expect(screen.queryByText('Map View')).toBeNull()
120+
fireEvent.click(screen.getByRole('button', { name: 'List View' }))
118121
expect(screen.queryByText('List View')).toBeNull()
119122
fireEvent.click(screen.getByRole('button', { name: 'Map View' }))
120-
expect(screen.queryByText('Map View')).toBeNull()
121123
fireEvent.click(screen.getByRole('button', { name: 'List View' }))
122124
screen.getByText('Labware')
123125
screen.getByText('Labware name')
@@ -126,6 +128,7 @@ describe('ProtocolSetupLabware', () => {
126128

127129
it('sends a latch-close command when the labware latch is open and the button is clicked', () => {
128130
render()
131+
fireEvent.click(screen.getByRole('button', { name: 'List View' }))
129132
fireEvent.click(screen.getByText('Labware Latch'))
130133
expect(mockCreateLiveCommand).toHaveBeenCalledWith({
131134
command: {
@@ -144,6 +147,7 @@ describe('ProtocolSetupLabware', () => {
144147
refetch: mockRefetch,
145148
} as any)
146149
render()
150+
fireEvent.click(screen.getByRole('button', { name: 'List View' }))
147151
fireEvent.click(screen.getByText('Labware Latch'))
148152
expect(mockCreateLiveCommand).toHaveBeenCalledWith({
149153
command: {
@@ -162,15 +166,16 @@ describe('ProtocolSetupLabware', () => {
162166
)
163167

164168
render()
169+
fireEvent.click(screen.getByRole('button', { name: 'List View' }))
165170
screen.getByText('Opening...')
166171
})
167172

168173
it('shows closing transition state of the labware latch button', () => {
169174
vi.mocked(useModulesQuery).mockReturnValue(
170175
mockUseModulesQueryClosing as any
171176
)
172-
173177
render()
178+
fireEvent.click(screen.getByRole('button', { name: 'List View' }))
174179
screen.getByText('Closing...')
175180
})
176181

@@ -180,6 +185,7 @@ describe('ProtocolSetupLabware', () => {
180185
)
181186

182187
render()
188+
fireEvent.click(screen.getByRole('button', { name: 'List View' }))
183189
screen.getByText('Open')
184190
})
185191
})

app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function ProtocolSetupLabware({
8383
setIsConfirmed,
8484
}: ProtocolSetupLabwareProps): JSX.Element {
8585
const { t } = useTranslation('protocol_setup')
86-
const [showMapView, setShowMapView] = useState<boolean>(false)
86+
const [showMapView, setShowMapView] = useState<boolean>(true)
8787
const [
8888
showLabwareDetailsModal,
8989
setShowLabwareDetailsModal,

0 commit comments

Comments
 (0)