Skip to content

Commit 4daf390

Browse files
committed
Update styling and tests
1 parent aa2dfd9 commit 4daf390

File tree

8 files changed

+55
-63
lines changed

8 files changed

+55
-63
lines changed

app/src/organisms/Desktop/ProtocolDetails/ProtocolLabwareDetails.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const ProtocolLabwareDetails = (props: {
6262
<ProtocolLabwareDetailItem
6363
key={index}
6464
namespace={labware.namespace}
65-
displayName={labware.displayName}
65+
displayName={labware.labwareDef.metadata.displayName}
6666
quantity={labware.quantity}
6767
labware={{ definition: labware.labwareDef }}
6868
lidDisplayName={labware.lidDisplayName}

app/src/organisms/Desktop/ProtocolDetails/__tests__/ProtocolLabwareDetails.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('ProtocolLabwareDetails', () => {
7777
let props: ComponentProps<typeof ProtocolLabwareDetails>
7878
beforeEach(() => {
7979
props = {
80-
loadLabwareCommands: mockRequiredLabwareDetails,
80+
commands: mockRequiredLabwareDetails,
8181
}
8282
})
8383

@@ -148,7 +148,7 @@ describe('ProtocolLabwareDetails', () => {
148148

149149
it('should render mock infoscreen when no labware', () => {
150150
props = {
151-
loadLabwareCommands: [],
151+
commands: [],
152152
}
153153
render(props)
154154
screen.getByText('mock InfoScreen')

app/src/pages/ODD/ProtocolDetails/Labware.tsx

+10-7
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ export const Labware = (props: { protocolId: string }): JSX.Element => {
8686
</tr>
8787
</thead>
8888
<tbody>
89-
{labwareItems.map(labware => {
89+
{labwareItems.map((labware, index) => {
9090
return (
91-
<TableRow key={labware.displayName}>
91+
<TableRow key={index}>
9292
<TableDatum>
9393
<Flex
9494
flexDirection={DIRECTION_ROW}
@@ -107,16 +107,19 @@ export const Labware = (props: { protocolId: string }): JSX.Element => {
107107
) : (
108108
<Flex marginLeft={SPACING.spacing20} />
109109
)}
110-
<Flex flexDirection={DIRECTION_COLUMN}>
110+
<Flex
111+
flexDirection={DIRECTION_COLUMN}
112+
gridGap={SPACING.spacing4}
113+
>
111114
<StyledText
112-
oddStyle="bodyTextRegular"
115+
oddStyle="bodyTextSemiBold"
113116
alignItems={ALIGN_CENTER}
114117
>
115-
{labware.displayName}
118+
{labware.labwareDef.metadata.displayName}
116119
</StyledText>
117120
{labware.lidDisplayName ? (
118121
<StyledText
119-
oddStyle="smallBodyTextRegular"
122+
oddStyle="bodyTextRegular"
120123
alignItems={ALIGN_CENTER}
121124
color={COLORS.grey60}
122125
>
@@ -128,7 +131,7 @@ export const Labware = (props: { protocolId: string }): JSX.Element => {
128131
</TableDatum>
129132
<TableDatum>
130133
<StyledText
131-
oddStyle="bodyTextRegular"
134+
oddStyle="bodyTextSemiBold"
132135
alignItems={ALIGN_CENTER}
133136
textAlign={TYPOGRAPHY.textAlignCenter}
134137
>

app/src/pages/ODD/ProtocolDetails/__tests__/Labware.test.tsx

+17-22
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,25 @@ describe('Labware', () => {
3636
.calledWith(MOCK_PROTOCOL_ID)
3737
.thenReturn([
3838
{
39-
definition: fixtureTiprack10ul as LabwareDefinition2,
40-
initialLocation: { slotName: '1' },
41-
moduleLocation: null,
42-
moduleModel: null,
43-
nickName: null,
39+
labwareDef: fixtureTiprack10ul as LabwareDefinition2,
40+
lidDisplayName: 'tiprack lid',
41+
quantity: 1,
42+
namespace: 'opentrons',
4443
},
4544
{
46-
definition: fixtureTiprack300ul as LabwareDefinition2,
47-
initialLocation: { slotName: '3' },
48-
moduleLocation: null,
49-
moduleModel: null,
50-
nickName: null,
45+
labwareDef: fixtureTiprack300ul as LabwareDefinition2,
46+
quantity: 2,
47+
namespace: 'opentrons',
5148
},
5249
{
53-
definition: fixture96Plate as LabwareDefinition2,
54-
initialLocation: { slotName: '5' },
55-
moduleLocation: null,
56-
moduleModel: null,
57-
nickName: null,
50+
labwareDef: fixture96Plate as LabwareDefinition2,
51+
quantity: 1,
52+
namespace: 'opentrons',
5853
},
5954
{
60-
definition: fixtureTiprack10ul as LabwareDefinition2,
61-
initialLocation: { slotName: '7' },
62-
moduleLocation: null,
63-
moduleModel: null,
64-
nickName: null,
55+
labwareDef: fixtureTiprack10ul as LabwareDefinition2,
56+
quantity: 1,
57+
namespace: 'opentrons',
6558
},
6659
])
6760
})
@@ -76,8 +69,10 @@ describe('Labware', () => {
7669
})
7770
it('should render the correct location, name, and connected status in each table row', () => {
7871
render(props)
79-
screen.getByRole('row', { name: 'Opentrons GEB 10uL Tiprack 2' })
80-
screen.getByRole('row', { name: '300ul Tiprack FIXTURE 1' })
72+
screen.getByRole('row', {
73+
name: 'Opentrons GEB 10uL Tiprack with tiprack lid 1',
74+
})
75+
screen.getByRole('row', { name: '300ul Tiprack FIXTURE 2' })
8176
screen.getByRole('row', { name: 'ANSI 96 Standard Microplate 1' })
8277
})
8378
})

app/src/pages/ODD/QuickTransferDetails/Labware.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ export const Labware = (props: { transferId: string }): JSX.Element => {
8181
</tr>
8282
</thead>
8383
<tbody>
84-
{labwareItems.map(labware => {
84+
{labwareItems.map((labware, index) => {
8585
return (
86-
<TableRow key={labware.displayName}>
86+
<TableRow key={index}>
8787
<TableDatum>
8888
<Flex
8989
flexDirection={DIRECTION_ROW}
@@ -101,14 +101,17 @@ export const Labware = (props: { transferId: string }): JSX.Element => {
101101
) : (
102102
<Flex marginLeft={SPACING.spacing20} />
103103
)}
104-
<StyledText as="p" alignItems={ALIGN_CENTER}>
105-
{labware.displayName}
104+
<StyledText
105+
oddStyle="bodyTextSemiBold"
106+
alignItems={ALIGN_CENTER}
107+
>
108+
{labware.labwareDef.metadata.displayName}
106109
</StyledText>
107110
</Flex>
108111
</TableDatum>
109112
<TableDatum>
110113
<StyledText
111-
as="p"
114+
oddStyle="bodyTextSemiBold"
112115
alignItems={ALIGN_CENTER}
113116
textAlign={TYPOGRAPHY.textAlignCenter}
114117
>

app/src/pages/ODD/QuickTransferDetails/__tests__/Labware.test.tsx

+12-20
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,24 @@ describe('Labware', () => {
3434
.calledWith(MOCK_PROTOCOL_ID)
3535
.thenReturn([
3636
{
37-
definition: fixtureTiprack10ul as LabwareDefinition2,
38-
initialLocation: { slotName: '1' },
39-
moduleLocation: null,
40-
moduleModel: null,
41-
nickName: null,
37+
labwareDef: fixtureTiprack10ul as LabwareDefinition2,
38+
quantity: 1,
39+
namespace: 'opentrons',
4240
},
4341
{
44-
definition: fixtureTiprack300ul as LabwareDefinition2,
45-
initialLocation: { slotName: '3' },
46-
moduleLocation: null,
47-
moduleModel: null,
48-
nickName: null,
42+
labwareDef: fixtureTiprack300ul as LabwareDefinition2,
43+
quantity: 1,
44+
namespace: 'opentrons',
4945
},
5046
{
51-
definition: fixture96Plate as LabwareDefinition2,
52-
initialLocation: { slotName: '5' },
53-
moduleLocation: null,
54-
moduleModel: null,
55-
nickName: null,
47+
labwareDef: fixture96Plate as LabwareDefinition2,
48+
quantity: 1,
49+
namespace: 'opentrons',
5650
},
5751
{
58-
definition: fixtureTiprack10ul as LabwareDefinition2,
59-
initialLocation: { slotName: '7' },
60-
moduleLocation: null,
61-
moduleModel: null,
62-
nickName: null,
52+
labwareDef: fixtureTiprack10ul as LabwareDefinition2,
53+
quantity: 1,
54+
namespace: 'opentrons',
6355
},
6456
])
6557
})

app/src/resources/protocols/hooks/__tests__/useRequiredProtocolLabware.ts app/src/resources/protocols/hooks/__tests__/useRequiredProtocolLabware.test.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ describe('useRequiredProtocolLabware', () => {
5252
it('should return LabwareSetupItem array', () => {
5353
const { result } = renderHook(() => useRequiredProtocolLabware(PROTOCOL_ID))
5454
expect(result.current.length).toBe(1)
55-
expect(result.current[0].nickName).toEqual('first labware nickname')
56-
expect(result.current[0].definition.dimensions.xDimension).toBe(127.76)
57-
expect(result.current[0].definition.metadata.displayName).toEqual(
55+
expect(result.current[0].labwareDef.metadata.displayName).toEqual(
56+
'300ul Tiprack FIXTURE'
57+
)
58+
expect(result.current[0].labwareDef.dimensions.xDimension).toBe(127.76)
59+
expect(result.current[0].labwareDef.metadata.displayName).toEqual(
5860
'300ul Tiprack FIXTURE'
5961
)
6062
})

app/src/transformations/commands/transformations/getRequiredLabwareDetailsFromLoadCommands.ts

-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import type {
99

1010
export interface RequiredLabwareDetails {
1111
namespace: string
12-
displayName: string
1312
quantity: number
1413
labwareDef: LabwareDefinition2
1514
lidDisplayName?: string
@@ -49,7 +48,6 @@ export function getRequiredLabwareDetailsFromLoadCommands(
4948
if (!acc.has(defUri)) {
5049
acc.set(defUri, {
5150
namespace: command.params.namespace,
52-
displayName: command.result?.definition.metadata.displayName,
5351
labwareDef: command.result?.definition,
5452
quantity: 0,
5553
})
@@ -73,7 +71,6 @@ export function getRequiredLabwareDetailsFromLoadCommands(
7371
if (!acc.has(defUri)) {
7472
acc.set(defUri, {
7573
namespace: command.params.namespace,
76-
displayName: command.result?.definition.metadata.displayName,
7774
labwareDef: command.result?.definition,
7875
quantity: 0,
7976
lidDisplayName:

0 commit comments

Comments
 (0)