For CE-1280 - add helpContent to process steps

This commit is contained in:
2024-05-15 19:31:40 -05:00
parent 2d9ea8b73f
commit 04547577f7
3 changed files with 125 additions and 2 deletions

View File

@ -167,6 +167,36 @@ class QInstanceHelpContentManagerTest extends BaseTest
QInstance qInstance = QContext.getQInstance();
new HelpContentMetaDataProvider().defineAll(qInstance, TestUtils.MEMORY_BACKEND_NAME, null);
HelpContent recordEntity = new HelpContent()
.withId(1)
.withKey("process:" + TestUtils.PROCESS_NAME_GREET_PEOPLE_INTERACTIVE + ";step:setup")
.withContent("v1")
.withRole(HelpContentRole.PROCESS_SCREEN.getId());
new InsertAction().execute(new InsertInput(HelpContent.TABLE_NAME).withRecordEntity(recordEntity));
///////////////////////////////////////////////////////////////////////////////////////////////
// now - post-insert customizer should have automatically added help content to the instance //
///////////////////////////////////////////////////////////////////////////////////////////////
List<QHelpContent> helpContents = qInstance.getProcess(TestUtils.PROCESS_NAME_GREET_PEOPLE_INTERACTIVE).getFrontendStep("setup").getHelpContents();
assertEquals(1, helpContents.size());
assertEquals("v1", helpContents.get(0).getContent());
assertEquals(Set.of(QHelpRole.PROCESS_SCREEN), helpContents.get(0).getRoles());
}
/*******************************************************************************
**
*******************************************************************************/
@Test
void testProcessStep() throws QException
{
/////////////////////////////////////
// get the instance from base test //
/////////////////////////////////////
QInstance qInstance = QContext.getQInstance();
new HelpContentMetaDataProvider().defineAll(qInstance, TestUtils.MEMORY_BACKEND_NAME, null);
//////////////////////////////////////////////////////////
// first, assert there's no help content on the section //
//////////////////////////////////////////////////////////