Skip to content

Commit

Permalink
Added forceRun to the test configuration to allow it to pass the trig…
Browse files Browse the repository at this point in the history
…gerCondition
  • Loading branch information
andrewbrazzatti committed Dec 16, 2024
1 parent 00f9d6d commit b7cafad
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/unit/services/TriggerService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('The TriggerService', function () {
fieldLanguageCode: "title-required",
arrayObjFieldDBName: 'row-item',
trimLeadingAndTrailingSpacesBeforeValidation: true,
forceRun: true
// caseSensitive: true, - default
// allowNulls: true, - default
};
Expand All @@ -31,6 +32,7 @@ describe('The TriggerService', function () {
trimLeadingAndTrailingSpacesBeforeValidation: false,
caseSensitive: true,
allowNulls: false,
forceRun: true
};
try {
await TriggerService.validateFieldUsingRegex(oid, record, options);
Expand All @@ -55,6 +57,7 @@ describe('The TriggerService', function () {
trimLeadingAndTrailingSpacesBeforeValidation: false,
caseSensitive: false,
allowNulls: true,
forceRun: true
};

try {
Expand All @@ -77,6 +80,7 @@ describe('The TriggerService', function () {
trimLeadingAndTrailingSpacesBeforeValidation: false,
caseSensitive: false,
allowNulls: true,
forceRun: true
};
const result = await TriggerService.validateFieldUsingRegex(oid, record, options);
expect(result).to.eql(record);
Expand All @@ -92,6 +96,7 @@ describe('The TriggerService', function () {
trimLeadingAndTrailingSpacesBeforeValidation: false,
caseSensitive: false,
allowNulls: false,
forceRun: true
};
try {
await TriggerService.validateFieldUsingRegex(oid, record, options);
Expand All @@ -114,7 +119,8 @@ describe('The TriggerService', function () {
if (_.get(record,'testing-field') !== 'valid-value') {
addError(errorList, 'testing-field', 'title-required', 'invalid-format' );
}
return errorList; %>`
return errorList; %>`,
forceRun: true
};

try {
Expand All @@ -134,7 +140,8 @@ describe('The TriggerService', function () {
if (_.get(record,'testing-field') !== 'valid-value') {
addError(errorList, 'testing-field', 'title-required', 'invalid-format' );
}
return errorList; %>`
return errorList; %>`,
forceRun: true
};
try {
const result = await TriggerService.validateFieldsUsingTemplate(oid, record, options);
Expand Down

0 comments on commit b7cafad

Please sign in to comment.