fix(xod-project): add one more case for migrating bound pulse values into new literals

This commit is contained in:
Kirill Shumilov
2018-05-14 13:59:33 +03:00
committed by Victor Nakoryakov
parent 9b33d68dfa
commit ec3fc3b371
2 changed files with 7 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ export const ensureLiteral = def(
case PIN_TYPE.PULSE:
return R.compose(
R.when(
R.equals(false),
R.either(R.equals(false), R.equals('false')),
R.always(INPUT_PULSE_PIN_BINDING_OPTIONS.NEVER)
),
R.when(

View File

@@ -73,6 +73,12 @@ describe('Legacy', () => {
ensureLiteral(PIN_TYPE.PULSE, false),
'Never'
);
// Sometimes Never was a string "false"
// when User binds `Never` to terminal in the Inspector
assert.strictEqualJustValue(
ensureLiteral(PIN_TYPE.PULSE, 'false'),
'Never'
);
assert.strictEqualJustValue(
ensureLiteral(PIN_TYPE.PULSE, 'NEVER'),
'Never'