Skip to content

Commit

Permalink
✅ [#4269] Update existing DMN stories and add one
Browse files Browse the repository at this point in the history
Updated the assertions for the existing stories so that the
interaction tests pass again.

Added a story for the complex expression cases.
  • Loading branch information
sergei-maertens committed May 8, 2024
1 parent f7121f5 commit 3d83dfd
Showing 1 changed file with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,33 @@ export default {
{
label: 'Direction',
id: 'Input_1',
type_ref: 'string',
typeRef: 'string',
expression: 'direction',
},
{
label: 'Port number',
id: 'InputClause_1cn8gp3',
type_ref: 'integer',
typeRef: 'integer',
expression: 'port',
},
{
label: 'Camunda variable',
id: 'InputClause_1f09wt8',
type_ref: 'string',
typeRef: 'string',
expression: 'camundaVar',
},
],
outputs: [
{
id: 'Output_1',
label: 'Policy',
type_ref: 'string',
typeRef: 'string',
name: 'policy',
},
{
id: 'OutputClause_0lzmnio',
label: 'Reason',
type_ref: 'string',
typeRef: 'string',
name: 'reason',
},
],
Expand All @@ -96,50 +96,62 @@ export default {
id: 'clause1',
label: 'Invoice Amount',
expression: 'amount',
type_ref: 'double',
typeRef: 'double',
},
{
id: 'InputClause_15qmk0v',
label: 'Invoice Category',
expression: 'invoiceCategory',
type_ref: 'string',
typeRef: 'string',
},
],
outputs: [
{
id: 'clause3',
label: 'Classification',
name: 'invoiceClassification',
type_ref: 'string',
typeRef: 'string',
},
{
id: 'OutputClause_1cthd0w',
label: 'Approver Group',
name: 'result',
type_ref: 'string',
typeRef: 'string',
},
],
},
withComplexExpressions: {
inputs: [
{
label: 'Simple variable',
id: '',
typeRef: 'string',
expression: 'foo',
},
{
label: 'Sum of a and b',
id: '',
type_ref: 'integer',
typeRef: 'integer',
expression: 'a + b',
},
{
label: 'Numeric part postcode',
id: '',
type_ref: 'integer',
typeRef: 'integer',
expression: 'number(substring(postcode, 1, 4))',
},
{
label: 'Weird but valid syntax',
id: '',
typeRef: 'integer',
expression: 'a+b',
},
],
outputs: [
{
id: 'OutputClause_1cthd0w',
label: 'Sole output',
type_ref: 'string',
typeRef: 'string',
name: 'result',
},
],
Expand Down Expand Up @@ -189,7 +201,7 @@ export const Empty = {
await waitFor(async () => {
const renderedOptions = within(decisionDefDropdown).getAllByRole('option');

await expect(renderedOptions.length).toBe(3);
await expect(renderedOptions.length).toBe(4);
});

await userEvent.selectOptions(decisionDefDropdown, 'Approve payment');
Expand Down Expand Up @@ -218,7 +230,7 @@ export const Empty = {

const [formVarsDropdowns, dmnVarsDropdown] = dropdowns;

await userEvent.selectOptions(formVarsDropdowns, 'Name');
await userEvent.selectOptions(formVarsDropdowns, 'Name (name)');
await userEvent.selectOptions(dmnVarsDropdown, 'camundaVar');

await expect(formVarsDropdowns.value).toBe('name');
Expand Down

0 comments on commit 3d83dfd

Please sign in to comment.