From 91d3744f02bdf93fb1558e4c39be129d175ff8cc Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Tue, 9 Aug 2022 13:56:12 -0400 Subject: [PATCH] test for message payload --- test/spec/MessagesSpec.js | 21 +++++++++++++++++++-- test/spec/helpers.js | 4 ++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/test/spec/MessagesSpec.js b/test/spec/MessagesSpec.js index 2320ed8..4e72902 100644 --- a/test/spec/MessagesSpec.js +++ b/test/spec/MessagesSpec.js @@ -1,5 +1,5 @@ import TestContainer from 'mocha-test-container-support'; -import {bootstrapPropertiesPanel, expectSelected, findEntry, findGroupEntry, findSelect} from './helpers'; +import { bootstrapPropertiesPanel, expectSelected, findEntry, findGroupEntry, findInput, findSelect, findTextarea } from './helpers'; import { BpmnPropertiesPanelModule, BpmnPropertiesProviderModule } from 'bpmn-js-properties-panel'; import spiffModdleExtension from '../../app/spiffworkflow/moddle/spiffworkflow.json'; import messages from '../../app/spiffworkflow/messages'; @@ -59,8 +59,25 @@ describe('Messages should work', function() { expect(selector).to.exist; expect(selector.length).to.equal(2); + }); + + it('should show the payload inside the message group',async function() { + + // Select the second Task + const send_shape = await expectSelected('ActivitySendLetter'); + expect(send_shape, "Can't find Send Task").to.exist; + + // THEN - there is a payload. + let payload = findEntry('messagePayload', container); + expect(payload, "Can't find the message payload").to.exist; + + let textArea = findTextarea('bio-properties-panel-messagePayload', container); + expect(textArea, "Can't find the payload text").to.exist; + expect(textArea.innerHTML, "Can't find innerHTML").to.exist; + + console.log('innerHTML', textArea.innerHTML); }); -}); + }); diff --git a/test/spec/helpers.js b/test/spec/helpers.js index 835d590..5b83e3a 100644 --- a/test/spec/helpers.js +++ b/test/spec/helpers.js @@ -111,6 +111,10 @@ export function findInput(type, container) { return domQuery(`input[type='${ type }']`, container); } +export function findTextarea(id, container) { + return domQuery(`textarea[id='${ id }']`, container); +} + export function findButton(id, container) { return domQuery(`button[id='${ id }']`, container); }