Skip to content

Commit edbfbb2

Browse files
fix(app): module setup flow allow TC add/remove (#19143)
1 parent 5a0ba02 commit edbfbb2

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

shared-data/js/__tests__/fixtures.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
2121
STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
2222
TEMPERATURE_MODULE_V2_FIXTURE,
23+
THERMOCYCLER_MODULE_V2,
2324
WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
2425
WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
2526
} from '..'
@@ -599,6 +600,21 @@ describe('isModuleAllowedOnAA', () => {
599600
const vs = isModuleAllowedOnAA('cutoutD3', 'D3', 'temperatureModuleV2')
600601
expect(vs).toEqual(true)
601602
})
603+
604+
it('should return true for thermocycler on A1', () => {
605+
const vs = isModuleAllowedOnAA('cutoutA1', 'A1', THERMOCYCLER_MODULE_V2)
606+
expect(vs).toEqual(true)
607+
})
608+
609+
it('should return true for thermocycler on B1', () => {
610+
const vs = isModuleAllowedOnAA('cutoutB1', 'B1', THERMOCYCLER_MODULE_V2)
611+
expect(vs).toEqual(true)
612+
})
613+
614+
it('should return false for thermocycler on A3', () => {
615+
const vs = isModuleAllowedOnAA('cutoutA3', 'A3', THERMOCYCLER_MODULE_V2)
616+
expect(vs).toEqual(false)
617+
})
602618
})
603619

604620
describe('getAAForModuleFixture', () => {

shared-data/js/fixtures.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
FLEX_STACKER_FIXTURES,
1212
FLEX_STAGING_ADDRESSABLE_AREAS_WITH_FAKES,
1313
FLEX_USB_MODULE_FIXTURES,
14+
THERMOCYCLER_MODULE_CUTOUTS,
1415
WASTE_CHUTE_FIXTURES,
1516
WASTE_CHUTE_WITH_FAKE_FIXTURES,
1617
} from '.'
@@ -1217,6 +1218,9 @@ export const isModuleAllowedOnAA = (
12171218
aa: AddressableAreaNamesWithFakes,
12181219
moduleModel: ModuleModel
12191220
): boolean => {
1221+
if (moduleModel === THERMOCYCLER_MODULE_V2) {
1222+
return THERMOCYCLER_MODULE_CUTOUTS.includes(cutoutId)
1223+
}
12201224
const fixtureId = getCutoutFixtureIdsForModuleModel(moduleModel)
12211225
const aaForFixture = getAAWithFakesFromCutoutFixtureId(
12221226
cutoutId,
@@ -1288,6 +1292,14 @@ export const replaceCutoutFixtureWithComboFixture = (
12881292
return addedCutoutConfigs.map(aaCutoutItem => {
12891293
console.log('Processing cutout item:', aaCutoutItem)
12901294

1295+
if (
1296+
THERMOCYCLER_MODULE_CUTOUTS.includes(cutoutId) &&
1297+
MODULE_FIXTURES_BY_MODEL.thermocyclerModuleV2?.includes(
1298+
aaCutoutItem.cutoutFixtureId as CutoutFixtureId
1299+
)
1300+
) {
1301+
return { ...aaCutoutItem }
1302+
}
12911303
// Filter potential combo fixture options
12921304
const comboFixturesOptions = Object.entries(
12931305
addressableAreasById

0 commit comments

Comments
 (0)