Skip to content

Commit 06b59d9

Browse files
spgRomainMuller
authored andcommitted
fix(stepfunctions): Actually perform rendering of NotCondition
Without this fix, the `Not` condition would render as (notice that `variable`, `comparisonOperator` and `value` are not capitalized): ``` { Not: VariableComparison { variable: '$.a', comparisonOperator: 0, value: 'b' } } ```
1 parent 3790858 commit 06b59d9

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

packages/@aws-cdk/aws-stepfunctions/lib/condition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class NotCondition extends Condition {
221221

222222
public renderCondition(): any {
223223
return {
224-
Not: this.comparisonOperation
224+
Not: this.comparisonOperation.renderCondition()
225225
};
226226
}
227-
}
227+
}

packages/@aws-cdk/aws-stepfunctions/test/test.condition.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,17 @@ export = {
88
});
99

1010
test.done();
11-
}
11+
},
12+
'NotConditon must render properly'(test: Test) {
13+
// GIVEN
14+
const condition = stepfunctions.Condition.not(stepfunctions.Condition.stringEquals('$.a', 'b'));
15+
16+
// WHEN
17+
const render = condition.renderCondition();
18+
19+
// THEN
20+
test.deepEqual(render, {Not: {Variable: '$.a', StringEquals: 'b'}});
21+
22+
test.done();
23+
},
1224
};

0 commit comments

Comments
 (0)