Feat v0.9.6 stage mode collapse (#80)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m49s
CI/CD / test-sqlite (push) Successful in 3m4s
CI/CD / build-and-deploy (push) Successful in 1m15s
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m49s
CI/CD / test-sqlite (push) Successful in 3m4s
CI/CD / build-and-deploy (push) Successful in 1m15s
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #80.
This commit is contained in:
@@ -408,7 +408,7 @@
|
||||
var fwfSlug = testTag + '-form-wf';
|
||||
var fChannelId = null;
|
||||
|
||||
await T.test('crud', 'workflows', 'form: create form_only workflow', async function () {
|
||||
await T.test('crud', 'workflows', 'form: create form workflow', async function () {
|
||||
var wf = await T.apiPost('/workflows', {
|
||||
name: testTag + ' Form WF',
|
||||
slug: fwfSlug,
|
||||
@@ -422,7 +422,7 @@
|
||||
name: 'Contact Info',
|
||||
ordinal: 0,
|
||||
history_mode: 'full',
|
||||
stage_mode: 'form_only',
|
||||
stage_mode: 'form',
|
||||
form_template: {
|
||||
fields: [
|
||||
{ key: 'name', type: 'text', label: 'Full Name', required: true, validation: { min_length: 2 } },
|
||||
@@ -436,7 +436,7 @@
|
||||
});
|
||||
|
||||
await T.apiPost('/workflows/' + fwfId + '/stages', {
|
||||
name: 'Done', ordinal: 1, history_mode: 'full', stage_mode: 'chat_only'
|
||||
name: 'Done', ordinal: 1, history_mode: 'full', stage_mode: 'form'
|
||||
});
|
||||
|
||||
await T.apiPatch('/workflows/' + fwfId, { is_active: true });
|
||||
@@ -456,7 +456,7 @@
|
||||
var d = await T.sessionGet('/w/' + fChannelId + '/form');
|
||||
T.assert(d._status === 200, 'expected 200, got ' + d._status);
|
||||
T.assertHasKey(d, 'stage_mode', 'form response');
|
||||
T.assert(d.stage_mode === 'form_only', 'expected form_only, got ' + d.stage_mode);
|
||||
T.assert(d.stage_mode === 'form', 'expected form, got ' + d.stage_mode);
|
||||
T.assertHasKey(d, 'form_template', 'form response');
|
||||
T.assert(d.form_template.fields && d.form_template.fields.length === 3,
|
||||
'expected 3 fields, got ' + (d.form_template.fields ? d.form_template.fields.length : 0));
|
||||
@@ -520,7 +520,7 @@
|
||||
var xwfSlug = testTag + '-xvisitor';
|
||||
var chA = null, chB = null;
|
||||
|
||||
await T.test('crud', 'workflows', 'xvisitor: setup form_only workflow', async function () {
|
||||
await T.test('crud', 'workflows', 'xvisitor: setup form workflow', async function () {
|
||||
var wf = await T.apiPost('/workflows', {
|
||||
name: testTag + ' XVisitor',
|
||||
slug: xwfSlug,
|
||||
@@ -530,7 +530,7 @@
|
||||
T.registerCleanup(function () { if (xwfId) return T.safeDelete('/workflows/' + xwfId); });
|
||||
|
||||
await T.apiPost('/workflows/' + xwfId + '/stages', {
|
||||
name: 'Form', ordinal: 0, stage_mode: 'form_only', history_mode: 'full',
|
||||
name: 'Form', ordinal: 0, stage_mode: 'form', history_mode: 'full',
|
||||
form_template: {
|
||||
fields: [{ key: 'name', type: 'text', label: 'Name', required: true }]
|
||||
}
|
||||
@@ -627,7 +627,7 @@
|
||||
var s1 = await T.apiPost('/workflows/' + wpWfId + '/stages', {
|
||||
name: 'Intake',
|
||||
ordinal: 0,
|
||||
stage_mode: 'form_only',
|
||||
stage_mode: 'form',
|
||||
history_mode: 'full',
|
||||
form_template: { fields: [{ key: 'name', type: 'text', label: 'Full Name', required: true }] }
|
||||
});
|
||||
@@ -637,7 +637,7 @@
|
||||
var s2 = await T.apiPost('/workflows/' + wpWfId + '/stages', {
|
||||
name: 'Review',
|
||||
ordinal: 1,
|
||||
stage_mode: 'review',
|
||||
stage_mode: 'form',
|
||||
history_mode: 'summary'
|
||||
});
|
||||
T.assertShape(s2, T.S.workflowStage, 'stage2');
|
||||
@@ -650,7 +650,7 @@
|
||||
// Use the ICD test runner's own package ID (always installed when tests run).
|
||||
var realPkgId = 'icd-test-runner';
|
||||
var stageBase = {
|
||||
name: 'Intake', ordinal: 0, stage_mode: 'form_only', history_mode: 'full',
|
||||
name: 'Intake', ordinal: 0, stage_mode: 'form', history_mode: 'full',
|
||||
form_template: { fields: [{ key: 'name', type: 'text', label: 'Full Name', required: true }] }
|
||||
};
|
||||
|
||||
@@ -720,8 +720,8 @@
|
||||
T.assert(stList.length === 2, 'should have 2 stages, got ' + stList.length);
|
||||
T.assert(stList[0].name === 'Intake', 'stage 0 name should be Intake');
|
||||
T.assert(stList[1].name === 'Review', 'stage 1 name should be Review');
|
||||
T.assert(stList[0].stage_mode === 'form_only', 'stage 0 mode should be form_only');
|
||||
T.assert(stList[1].stage_mode === 'review', 'stage 1 mode should be review');
|
||||
T.assert(stList[0].stage_mode === 'form', 'stage 0 mode should be form');
|
||||
T.assert(stList[1].stage_mode === 'form', 'stage 1 mode should be form');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user