Skip to content

Commit cb65905

Browse files
authored
feat(opentrons-ai-client): filter out retired and old labware (#16775)
1 parent 404657e commit cb65905

File tree

14 files changed

+58
-42
lines changed

14 files changed

+58
-42
lines changed

opentrons-ai-client/src/molecules/ControlledLabwareListItems/__tests__/ControlledLabwareListItems.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const TestFormProviderComponent = () => {
1010
defaultValues: {
1111
labwares: [
1212
{
13-
labwareURI: 'opentrons/eppendorf_96_tiprack_1000ul_eptips/1',
13+
labwareURI: 'opentrons/opentrons_flex_96_tiprack_1000ul/1',
1414
count: 1,
1515
},
1616
{
17-
labwareURI: 'opentrons/eppendorf_96_tiprack_10ul_eptips/1',
17+
labwareURI: 'opentrons/opentrons_flex_96_tiprack_50ul/1',
1818
count: 1,
1919
},
2020
],
@@ -39,10 +39,10 @@ describe('ControlledLabwareListItems', () => {
3939
render()
4040

4141
expect(
42-
screen.getByText('(Retired) Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL')
42+
screen.getByText('Opentrons Flex 96 Tip Rack 1000 µL')
4343
).toBeInTheDocument()
4444
expect(
45-
screen.getByText('(Retired) Eppendorf epT.I.P.S. 96 Tip Rack 10 µL')
45+
screen.getByText('Opentrons Flex 96 Tip Rack 50 µL')
4646
).toBeInTheDocument()
4747
})
4848

@@ -64,15 +64,15 @@ describe('ControlledLabwareListItems', () => {
6464
render()
6565

6666
expect(
67-
screen.getByText('(Retired) Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL')
67+
screen.getByText('Opentrons Flex 96 Tip Rack 1000 µL')
6868
).toBeInTheDocument()
6969

7070
const removeButton = screen.getAllByText('Remove')[0]
7171
fireEvent.click(removeButton)
7272

7373
await waitFor(() => {
7474
expect(
75-
screen.queryByText('(Retired) Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL')
75+
screen.queryByText('Opentrons Flex 96 Tip Rack 1000 µL')
7676
).not.toBeInTheDocument()
7777
})
7878
})

opentrons-ai-client/src/molecules/ControlledLabwareListItems/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ import {
1010
import type { DropdownBorder } from '@opentrons/components'
1111
import { Controller, useFormContext } from 'react-hook-form'
1212
import { useTranslation } from 'react-i18next'
13-
import {
14-
getAllDefinitions,
15-
getLabwareDisplayName,
16-
} from '@opentrons/shared-data'
13+
import { getLabwareDisplayName } from '@opentrons/shared-data'
1714
import { LabwareDiagram } from '../../molecules/LabwareDiagram'
1815
import type { DisplayLabware } from '../../organisms/LabwareLiquidsSection'
1916
import { LABWARES_FIELD_NAME } from '../../organisms/LabwareLiquidsSection'
17+
import { getAllDefinitions } from '../../resources/utils'
2018

2119
export function ControlledLabwareListItems(): JSX.Element | null {
2220
const { t } = useTranslation('create_protocol')

opentrons-ai-client/src/molecules/InputPrompt/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
tokenAtom,
2424
} from '../../resources/atoms'
2525
import { useApiCall } from '../../resources/hooks'
26-
import { calcTextAreaHeight } from '../../resources/utils/utils'
26+
import { calcTextAreaHeight } from '../../resources/utils'
2727
import {
2828
STAGING_END_POINT,
2929
PROD_END_POINT,

opentrons-ai-client/src/molecules/ModuleListItemGroup/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
import type { DropdownBorder } from '@opentrons/components'
1111
import {
1212
ABSORBANCE_READER_TYPE,
13-
getAllDefinitions,
1413
getModuleDisplayName,
1514
HEATERSHAKER_MODULE_TYPE,
1615
MAGNETIC_BLOCK_TYPE,
@@ -23,6 +22,7 @@ import { Controller, useFormContext } from 'react-hook-form'
2322
import { ModuleDiagram } from '../ModelDiagram'
2423
import { MODULES_FIELD_NAME } from '../../organisms/ModulesSection'
2524
import type { DisplayModules } from '../../organisms/ModulesSection'
25+
import { getAllDefinitions } from '../../resources/utils'
2626
import { useTranslation } from 'react-i18next'
2727
import { useMemo } from 'react'
2828

opentrons-ai-client/src/organisms/LabwareLiquidsSection/__tests__/LabwareLiquidsSection.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('LabwareLiquidsSection', () => {
4444

4545
fireEvent.click(screen.getByText('Tip rack'))
4646
fireEvent.click(
47-
await screen.findByText('Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL')
47+
await screen.findByText('Opentrons Flex 96 Tip Rack 1000 µL')
4848
)
4949
fireEvent.click(screen.getByText('Save'))
5050

@@ -61,7 +61,7 @@ describe('LabwareLiquidsSection', () => {
6161

6262
// fireEvent.click(screen.getByText('Tip rack'))
6363
// fireEvent.click(
64-
// await screen.findByText('Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL')
64+
// await screen.findByText('Opentrons Flex 96 Tip Rack 1000 µL')
6565
// )
6666
// fireEvent.click(screen.getByText('Save'))
6767

opentrons-ai-client/src/organisms/LabwareModal/__tests__/LabwareModal.test.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ describe('LabwareModal', () => {
7373
render()
7474

7575
expect(
76-
screen.queryByText('Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL')
76+
screen.queryByText('Opentrons Flex 96 Tip Rack 1000 µL')
7777
).not.toBeInTheDocument()
7878

7979
const categoryButton = screen.getByText('Tip rack')
8080
categoryButton.click()
8181

8282
await waitFor(() => {
8383
expect(
84-
screen.getByText('Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL')
84+
screen.getByText('Opentrons Flex 96 Tip Rack 1000 µL')
8585
).toBeInTheDocument()
8686
})
8787
})
@@ -94,7 +94,7 @@ describe('LabwareModal', () => {
9494
categoryButton.click()
9595

9696
const labware = await screen.findByLabelText(
97-
'Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL'
97+
'Opentrons Flex 96 Tip Rack 1000 µL'
9898
)
9999
expect(labware).not.toBeChecked()
100100

@@ -111,10 +111,10 @@ describe('LabwareModal', () => {
111111
categoryButton.click()
112112

113113
const labware1 = await screen.findByLabelText(
114-
'Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL'
114+
'Opentrons Flex 96 Tip Rack 1000 µL'
115115
)
116116
const labware2 = await screen.findByLabelText(
117-
'Eppendorf epT.I.P.S. 96 Tip Rack 10 µL'
117+
'Opentrons Flex 96 Tip Rack 50 µL'
118118
)
119119

120120
labware1.click()
@@ -132,7 +132,7 @@ describe('LabwareModal', () => {
132132
categoryButton.click()
133133

134134
const labware = await screen.findByLabelText(
135-
'Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL'
135+
'Opentrons Flex 96 Tip Rack 1000 µL'
136136
)
137137
labware.click()
138138
labware.click()
@@ -152,7 +152,7 @@ describe('LabwareModal', () => {
152152
categoryButton.click()
153153

154154
const labware1 = await screen.findByLabelText(
155-
'Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL'
155+
'Opentrons Flex 96 Tip Rack 1000 µL'
156156
)
157157
labware1.click()
158158

@@ -180,7 +180,7 @@ describe('LabwareModal', () => {
180180
categoryButton.click()
181181

182182
const labware1 = await screen.findByLabelText(
183-
'Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL'
183+
'Opentrons Flex 96 Tip Rack 1000 µL'
184184
)
185185
labware1.click()
186186

@@ -191,7 +191,7 @@ describe('LabwareModal', () => {
191191

192192
await waitFor(() => {
193193
expect(
194-
screen.getByText('opentrons/eppendorf_96_tiprack_1000ul_eptips/1')
194+
screen.getByText('opentrons/opentrons_flex_96_tiprack_1000ul/1')
195195
).toBeInTheDocument()
196196
})
197197
})
@@ -208,7 +208,7 @@ describe('LabwareModal', () => {
208208
categoryButton.click()
209209

210210
const labware1 = await screen.findByLabelText(
211-
'Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL'
211+
'Opentrons Flex 96 Tip Rack 1000 µL'
212212
)
213213
labware1.click()
214214

@@ -219,7 +219,7 @@ describe('LabwareModal', () => {
219219

220220
await waitFor(() => {
221221
expect(
222-
screen.getByText('opentrons/eppendorf_96_tiprack_1000ul_eptips/1')
222+
screen.getByText('opentrons/opentrons_flex_96_tiprack_1000ul/1')
223223
).toBeInTheDocument()
224224
})
225225

@@ -230,7 +230,7 @@ describe('LabwareModal', () => {
230230

231231
await waitFor(() => {
232232
expect(
233-
screen.getByText('opentrons/eppendorf_96_tiprack_1000ul_eptips/1')
233+
screen.getByText('opentrons/opentrons_flex_96_tiprack_1000ul/1')
234234
).toBeInTheDocument()
235235
})
236236
})
@@ -241,20 +241,20 @@ describe('LabwareModal', () => {
241241

242242
const searchInput = screen.getByPlaceholderText('Search for labware...')
243243
fireEvent.change(searchInput, {
244-
target: { value: 'Eppendorf epT.I.P.S. 96 Tip Rack 10 µL' },
244+
target: { value: 'Opentrons Flex 96 Tip Rack 50 µL' },
245245
})
246246

247247
const categoryButton = screen.getByText('Tip rack')
248248
categoryButton.click()
249249

250250
await waitFor(() => {
251251
expect(
252-
screen.getByText('Eppendorf epT.I.P.S. 96 Tip Rack 10 µL')
252+
screen.getByText('Opentrons Flex 96 Tip Rack 50 µL')
253253
).toBeInTheDocument()
254254
})
255255

256256
expect(
257-
screen.queryByText('Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL')
257+
screen.queryByText('Opentrons Flex 96 Tip Rack 1000 µL')
258258
).not.toBeInTheDocument()
259259
})
260260
})

opentrons-ai-client/src/organisms/LabwareModal/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@ import {
1313
} from '@opentrons/components'
1414
import { useFormContext } from 'react-hook-form'
1515
import { useTranslation } from 'react-i18next'
16-
import type {
17-
LabwareDefByDefURI,
18-
LabwareDefinition2,
19-
} from '@opentrons/shared-data'
20-
import { getLabwareDefURI, getAllDefinitions } from '@opentrons/shared-data'
16+
import { getLabwareDefURI } from '@opentrons/shared-data'
2117
import React, { useEffect, useMemo, useState } from 'react'
2218
import { createPortal } from 'react-dom'
2319
import { reduce } from 'lodash'
2420
import { ListButtonCheckbox } from '../../atoms/ListButtonCheckbox/ListButtonCheckbox'
25-
import type { DisplayLabware } from '../LabwareLiquidsSection'
2621
import { LABWARES_FIELD_NAME } from '../LabwareLiquidsSection'
22+
import { getAllDefinitions } from '../../resources/utils'
23+
import type { DisplayLabware } from '../LabwareLiquidsSection'
24+
import type {
25+
LabwareDefByDefURI,
26+
LabwareDefinition2,
27+
} from '@opentrons/shared-data'
2728

2829
const ORDERED_CATEGORIES: string[] = [
2930
'tipRack',

opentrons-ai-client/src/pages/CreateProtocol/__tests__/CreateProtocol.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('CreateProtocol', () => {
163163

164164
expect(previewItems).toHaveLength(9)
165165
expect(previewItems[7]).toHaveTextContent(
166-
'Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL'
166+
'Opentrons Flex 96 Tip Rack 1000 µL'
167167
)
168168
expect(previewItems[8]).toHaveTextContent('Test liquid')
169169
})

opentrons-ai-client/src/resources/utils/__tests__/utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect } from 'vitest'
2-
import { calcTextAreaHeight } from '../utils'
2+
import { calcTextAreaHeight } from '../index'
33

44
describe('calcTextAreaHeight', () => {
55
it('should return the correct number of lines', () => {

opentrons-ai-client/src/resources/utils/createProtocolTestUtils.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ export async function fillLabwareLiquidsSectionAndClickConfirm(): Promise<void>
6262
fireEvent.click(addButton)
6363

6464
fireEvent.click(screen.getByText('Tip rack'))
65-
fireEvent.click(
66-
await screen.findByText('Eppendorf epT.I.P.S. 96 Tip Rack 1000 µL')
67-
)
65+
fireEvent.click(await screen.findByText('Opentrons Flex 96 Tip Rack 1000 µL'))
6866
fireEvent.click(screen.getByText('Save'))
6967

7068
fireEvent.change(screen.getByRole('textbox'), {

0 commit comments

Comments
 (0)