@@ -20,12 +20,12 @@ import {
20
20
} from '..'
21
21
import {
22
22
getAAComboFixtureDisplayName ,
23
- getAASlotIdForAA ,
23
+ getAAsToFixtureIdFromDeckDefWithFakes ,
24
24
getAAWithFakesFromCutoutFixtureId ,
25
25
getCutoutFixtureReplacementIfNeeded ,
26
- getFlexDeckDefAAByFixtureIdForCutoutId ,
27
26
getReplacementFixtureForFakeFixture ,
28
27
getReplacementFixtureForFixtureRemoval ,
28
+ getVisualSlotIdForAA ,
29
29
getVisualSlotIdFromAAId ,
30
30
isFixtureInUsbModules ,
31
31
replaceAAWithFakeAA ,
@@ -40,12 +40,14 @@ vi.mock('react-i18next', () => ({
40
40
useTranslation : vi . fn ( ) ,
41
41
} ) )
42
42
43
+ const deckDef = getDeckDefFromRobotType ( 'OT-3 Standard' )
44
+
43
45
describe ( 'getAAFromCutoutFixtureId' , ( ) => {
44
46
it ( 'Should get the aa for a cutoutId and a cutoutFixtureId' , ( ) => {
45
47
const result = getAAWithFakesFromCutoutFixtureId (
46
48
'cutoutD3' ,
47
49
'flexStackerModuleV1' ,
48
- getDeckDefFromRobotType ( FLEX_ROBOT_TYPE )
50
+ deckDef
49
51
)
50
52
51
53
const expectedOrder = [ 'flexStackerModuleV1D4' , 'D3' ]
@@ -56,7 +58,7 @@ describe('getAAFromCutoutFixtureId', () => {
56
58
const result = getAAWithFakesFromCutoutFixtureId (
57
59
'cutoutA1' ,
58
60
'flexStackerModuleV1' ,
59
- getDeckDefFromRobotType ( FLEX_ROBOT_TYPE )
61
+ deckDef
60
62
)
61
63
62
64
expect ( result ) . toBeUndefined ( )
@@ -194,7 +196,7 @@ describe('getCutoutFixtureReplacementIfNeeded', () => {
194
196
const result = getCutoutFixtureReplacementIfNeeded (
195
197
SINGLE_RIGHT_SLOT_FIXTURE ,
196
198
'cutoutA3' ,
197
- getDeckDefFromRobotType ( FLEX_ROBOT_TYPE )
199
+ deckDef
198
200
)
199
201
200
202
expect ( result ) . toEqual ( FAKE_STAGING_AREA_RIGHT_SLOT )
@@ -204,7 +206,7 @@ describe('getCutoutFixtureReplacementIfNeeded', () => {
204
206
const result = getCutoutFixtureReplacementIfNeeded (
205
207
STAGING_AREA_RIGHT_SLOT_FIXTURE ,
206
208
'cutoutB3' ,
207
- getDeckDefFromRobotType ( FLEX_ROBOT_TYPE )
209
+ deckDef
208
210
)
209
211
210
212
expect ( result ) . toEqual ( STAGING_AREA_RIGHT_SLOT_FIXTURE )
@@ -275,7 +277,10 @@ describe('getReplacementFixtureForFixtureRemoval', () => {
275
277
276
278
describe ( 'getFlexDeckDefAAByFixtureIdForCutoutId' , ( ) => {
277
279
it ( 'Should return a dic of fixtures and aa for cutoutA3' , ( ) => {
278
- const cutoutA3Result = getFlexDeckDefAAByFixtureIdForCutoutId ( 'cutoutA3' )
280
+ const cutoutA3Result = getAAsToFixtureIdFromDeckDefWithFakes (
281
+ 'cutoutA3' ,
282
+ deckDef
283
+ )
279
284
280
285
expect ( cutoutA3Result ) . toEqual ( {
281
286
singleRightSlot : [ 'A3' ] ,
@@ -300,14 +305,18 @@ describe('getFlexDeckDefAAByFixtureIdForCutoutId', () => {
300
305
} )
301
306
302
307
it ( 'Should return a dic of fixtures and aa for cutoutD3' , ( ) => {
303
- const cutoutD3Result = getFlexDeckDefAAByFixtureIdForCutoutId ( 'cutoutD3' )
308
+ const cutoutD3Result = getAAsToFixtureIdFromDeckDefWithFakes (
309
+ 'cutoutD3' ,
310
+ deckDef
311
+ )
312
+ console . log ( 'cutoutD3Result: ' , cutoutD3Result )
304
313
expect ( cutoutD3Result ) . toEqual ( {
305
314
absorbanceReaderV1 : [
306
315
'absorbanceReaderV1D3' ,
307
316
'absorbanceReaderV1LidDockD4' ,
308
317
] ,
309
318
fakeStagingAreaRightSlot : [ 'D3' , 'fakeD4' ] ,
310
- fakeStagingSlotWithMagBlockV1 : [ 'fakeD4 ' , 'magneticBlockV1D3 ' ] ,
319
+ fakeStagingSlotWithMagBlockV1 : [ 'magneticBlockV1D3 ' , 'fakeD4 ' ] ,
311
320
fakeWasteChuteWithEmptySlot : [ '96ChannelWasteChute' , 'fakeD4' ] ,
312
321
flexStackerModuleV1 : [ 'D3' , 'flexStackerModuleV1D4' ] ,
313
322
flexStackerModuleV1WithMagneticBlockV1 : [
@@ -358,7 +367,10 @@ describe('getFlexDeckDefAAByFixtureIdForCutoutId', () => {
358
367
} )
359
368
} )
360
369
it ( 'Should return a dic of fixtures and aa for cutoutA1' , ( ) => {
361
- const cutoutA1Result = getFlexDeckDefAAByFixtureIdForCutoutId ( 'cutoutA1' )
370
+ const cutoutA1Result = getAAsToFixtureIdFromDeckDefWithFakes (
371
+ 'cutoutA1' ,
372
+ deckDef
373
+ )
362
374
expect ( cutoutA1Result ) . toEqual ( {
363
375
singleLeftSlot : [ 'A1' ] ,
364
376
trashBinAdapter : [ 'movableTrashA1' ] ,
@@ -393,32 +405,32 @@ describe('getReplacementFixtureForFakeFixture', () => {
393
405
} )
394
406
} )
395
407
396
- describe ( 'getAASlotNameForAA ' , ( ) => {
397
- it ( 'should get aa name for single right slot' , ( ) => {
398
- const result = getAASlotIdForAA (
408
+ describe ( 'getVisualSlotIdForAA ' , ( ) => {
409
+ it ( 'should get vs name for single right slot' , ( ) => {
410
+ const result = getVisualSlotIdForAA (
399
411
'cutoutA3' ,
400
412
FAKE_STAGING_SLOT_WITH_MAG_BLOCK ,
401
413
'magneticBlockV1A3'
402
414
)
403
- expect ( result ) . toEqual ( 'A3 ' )
415
+ expect ( result ) . toEqual ( 'VSA3 ' )
404
416
} )
405
417
406
- it ( 'should return aa name for single center slot' , ( ) => {
407
- const result = getAASlotIdForAA (
418
+ it ( 'should return vs name for single center slot' , ( ) => {
419
+ const result = getVisualSlotIdForAA (
408
420
'cutoutD1' ,
409
421
TEMPERATURE_MODULE_V2_FIXTURE ,
410
422
'temperatureModuleV2D1'
411
423
)
412
- expect ( result ) . toEqual ( 'D1 ' )
424
+ expect ( result ) . toEqual ( 'VSD1 ' )
413
425
} )
414
426
415
- it ( 'should get input aa name for single center slot ' , ( ) => {
416
- const result = getAASlotIdForAA (
427
+ it ( 'should get vs id for mag block in D2 ' , ( ) => {
428
+ const result = getVisualSlotIdForAA (
417
429
'cutoutD2' ,
418
430
MAGNETIC_BLOCK_V1_FIXTURE ,
419
431
'magneticBlockV1D2'
420
432
)
421
- expect ( result ) . toEqual ( 'D2 ' )
433
+ expect ( result ) . toEqual ( 'VSD2 ' )
422
434
} )
423
435
} )
424
436
@@ -461,7 +473,7 @@ describe('getAAFixtureDisplayName', () => {
461
473
const name = getAAComboFixtureDisplayName (
462
474
FLEX_STACKER_WTIH_WASTE_CHUTE_ADAPTER_NO_COVER_FIXTURE ,
463
475
'flexStackerModuleV1D4' ,
464
- getDeckDefFromRobotType ( 'OT-3 Standard' ) ,
476
+ deckDef ,
465
477
t ,
466
478
''
467
479
)
@@ -472,7 +484,7 @@ describe('getAAFixtureDisplayName', () => {
472
484
const name = getAAComboFixtureDisplayName (
473
485
FLEX_STACKER_WITH_MAG_BLOCK_FIXTURE ,
474
486
'magneticBlockV1D3' ,
475
- getDeckDefFromRobotType ( 'OT-3 Standard' ) ,
487
+ deckDef ,
476
488
t ,
477
489
'deck_configuration'
478
490
)
@@ -483,7 +495,7 @@ describe('getAAFixtureDisplayName', () => {
483
495
const name = getAAComboFixtureDisplayName (
484
496
FLEX_STACKER_WITH_MAG_BLOCK_FIXTURE ,
485
497
'magneticBlockV1D3' ,
486
- getDeckDefFromRobotType ( 'OT-3 Standard' ) ,
498
+ deckDef ,
487
499
t ,
488
500
'deck_configuration'
489
501
)
@@ -494,7 +506,7 @@ describe('getAAFixtureDisplayName', () => {
494
506
const name = getAAComboFixtureDisplayName (
495
507
FAKE_WASTE_CHUTE_WITH_EMPTY_SLOT ,
496
508
'96ChannelWasteChute' ,
497
- getDeckDefFromRobotType ( 'OT-3 Standard' ) ,
509
+ deckDef ,
498
510
t ,
499
511
'deck_configuration'
500
512
)
@@ -505,7 +517,7 @@ describe('getAAFixtureDisplayName', () => {
505
517
const name = getAAComboFixtureDisplayName (
506
518
MAGNETIC_BLOCK_V1_FIXTURE ,
507
519
'magneticBlockV1D3' ,
508
- getDeckDefFromRobotType ( 'OT-3 Standard' ) ,
520
+ deckDef ,
509
521
t ,
510
522
'deck_configuration'
511
523
)
0 commit comments