@@ -15,11 +15,13 @@ import {
1515 forThermocyclerDeactivateBlock as _forThermocyclerDeactivateBlock ,
1616 forThermocyclerDeactivateLid as _forThermocyclerDeactivateLid ,
1717 forThermocyclerOpenLid as _forThermocyclerOpenLid ,
18+ forThermocyclerRunExtendedProfile as _forThermocyclerRunExtendedProfile ,
1819 forThermocyclerRunProfile as _forThermocyclerRunProfile ,
1920 forThermocyclerSetTargetBlockTemperature as _forThermocyclerSetTargetBlockTemperature ,
2021 forThermocyclerSetTargetLidTemperature as _forThermocyclerSetTargetLidTemperature ,
2122} from '../getNextRobotStateAndWarnings/thermocyclerUpdates'
2223
24+ import type { TCExtendedProfileParams } from '@opentrons/shared-data'
2325import type {
2426 ModuleOnlyParams ,
2527 TCProfileParams ,
@@ -60,6 +62,10 @@ const forThermocyclerOpenLid = makeImmutableStateUpdater(
6062const forThermocyclerRunProfile = makeImmutableStateUpdater (
6163 _forThermocyclerRunProfile
6264)
65+ const forThermocyclerRunExtendedProfile = makeImmutableStateUpdater (
66+ _forThermocyclerRunExtendedProfile
67+ )
68+
6369const moduleId = 'thermocyclerModuleId'
6470let invariantContext : InvariantContext
6571let lidOpenRobotState : RobotState
@@ -217,7 +223,7 @@ describe('thermocycler state updaters', () => {
217223 testName : 'forThermocyclerOpenLid should set lidOpen to true' ,
218224 } ,
219225 ]
220- const profileCases : TestCases < TCProfileParams > = [
226+ const runProfileCases : TestCases < TCProfileParams > = [
221227 {
222228 params : {
223229 moduleId,
@@ -229,34 +235,6 @@ describe('thermocycler state updaters', () => {
229235 fn : forThermocyclerRunProfile ,
230236 testName : 'forThermocyclerRunProfile should not make any updates' ,
231237 } ,
232- {
233- params : {
234- moduleId,
235- profile : [
236- {
237- holdSeconds : 10 ,
238- celsius : 50 ,
239- } ,
240- {
241- holdSeconds : 10 ,
242- celsius : 30 ,
243- } ,
244- {
245- holdSeconds : 10 ,
246- celsius : 0 ,
247- } ,
248- ] ,
249- blockMaxVolumeUl : 10 ,
250- } ,
251- moduleStateBefore : {
252- blockTargetTemp : 42 ,
253- } ,
254- expectedUpdate : {
255- blockTargetTemp : 0 ,
256- } ,
257- fn : forThermocyclerRunProfile ,
258- testName : 'forThermocyclerRunProfile should set blockTargetTemp to 0' ,
259- } ,
260238 {
261239 params : {
262240 moduleId,
@@ -283,27 +261,43 @@ describe('thermocycler state updaters', () => {
283261 blockTargetTemp : 20 ,
284262 } ,
285263 fn : forThermocyclerRunProfile ,
286- testName : 'forThermocyclerRunProfile should set blockTargetTemp to 20 ' ,
264+ testName : 'forThermocyclerRunProfile should set blockTargetTemp from the last profile step ' ,
287265 } ,
266+ ]
267+ const runExtendedProfileCases : TestCases < TCExtendedProfileParams > = [
288268 {
289269 params : {
290270 moduleId,
291- profile : [
271+ profileElements : [
292272 {
293273 holdSeconds : 10 ,
294- celsius : 30 ,
274+ celsius : 50 ,
275+ } ,
276+ {
277+ steps : [
278+ {
279+ holdSeconds : 10 ,
280+ celsius : 30 ,
281+ } ,
282+ {
283+ holdSeconds : 10 ,
284+ celsius : 40 ,
285+ } ,
286+ ] ,
287+ repetitions : 2 ,
295288 } ,
296289 ] ,
297290 blockMaxVolumeUl : 10 ,
298291 } ,
299292 moduleStateBefore : {
300- blockTargetTemp : 42 ,
293+ blockTargetTemp : 0 ,
301294 } ,
302295 expectedUpdate : {
303- blockTargetTemp : 30 ,
296+ blockTargetTemp : 40 ,
304297 } ,
305- fn : forThermocyclerRunProfile ,
306- testName : 'forThermocyclerRunProfile should set blockTargetTemp to 30' ,
298+ fn : forThermocyclerRunExtendedProfile ,
299+ testName :
300+ 'forThermocyclerRunExtendedProfile should set blockTargetTemp from the last profile step' ,
307301 } ,
308302 ]
309303
@@ -343,5 +337,6 @@ describe('thermocycler state updaters', () => {
343337 blockTempTestCase . forEach ( runTest )
344338 temperatureParamsCases . forEach ( runTest )
345339 moduleOnlyParamsCases . forEach ( runTest )
346- profileCases . forEach ( runTest )
340+ runProfileCases . forEach ( runTest )
341+ runExtendedProfileCases . forEach ( runTest )
347342} )
0 commit comments