updates to rotating machine struct
This commit is contained in:
22
test/integration/sequences.integration.test.js
Normal file
22
test/integration/sequences.integration.test.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
const Machine = require('../../src/specificClass');
|
||||
const { makeMachineConfig, makeStateConfig } = require('../helpers/factories');
|
||||
|
||||
test('execSequence startup reaches operational with zero transition times', async () => {
|
||||
const machine = new Machine(makeMachineConfig(), makeStateConfig());
|
||||
|
||||
await machine.handleInput('parent', 'execSequence', 'startup');
|
||||
|
||||
assert.equal(machine.state.getCurrentState(), 'operational');
|
||||
});
|
||||
|
||||
test('execMovement updates controller position in operational state', async () => {
|
||||
const machine = new Machine(makeMachineConfig(), makeStateConfig({ state: { current: 'operational' } }));
|
||||
|
||||
await machine.handleInput('parent', 'execMovement', 10);
|
||||
|
||||
const pos = machine.state.getCurrentPosition();
|
||||
assert.ok(pos >= 9.9 && pos <= 10);
|
||||
});
|
||||
Reference in New Issue
Block a user