Skip to content

Commit

Permalink
[semver:patch] Fix false positive notification assessments
Browse files Browse the repository at this point in the history
  • Loading branch information
DvirMalka committed Jan 19, 2023
1 parent 13c6064 commit 2bcab3d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions dist/development/strigo.sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -13032,8 +13032,8 @@ ${JSON.stringify(parsedContext)}` : "");
const { recordedAssessment, challengeSuccessEvent, _id } = assessment;
const { actionType, expectedText } = recordedAssessment;
if (actionType === "notification" /* NOTIFICATION */ && expectedText) {
const notificationText = window.document.body.innerText?.toLowerCase();
if (notificationText.indexOf(expectedText.toLowerCase())) {
const bodyText = window.document.body.innerText?.toLowerCase();
if (bodyText.length > 100 && bodyText.indexOf(expectedText.toLowerCase()) !== -1) {
LoggerInstance.info("*** Found notification text. Sending success event...");
window.Strigo.sendEvent(challengeSuccessEvent);
}
Expand Down
16 changes: 8 additions & 8 deletions dist/production/strigo.sdk.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/modules/no-code-assessment/no-code-assessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ const evaluateAssessments = function (): void {
const { actionType, expectedText } = recordedAssessment;

if (actionType === AssessmentActionType.NOTIFICATION && expectedText) {
const notificationText = window.document.body.innerText?.toLowerCase();
const bodyText = window.document.body.innerText?.toLowerCase();

if (notificationText.indexOf(expectedText.toLowerCase())) {
if (bodyText.length > 100 && bodyText.indexOf(expectedText.toLowerCase()) !== -1) {
Logger.info('*** Found notification text. Sending success event...');

window.Strigo.sendEvent(challengeSuccessEvent);
Expand Down

0 comments on commit 2bcab3d

Please sign in to comment.