Skip to content

Commit

Permalink
Make Fides rule more robust (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov authored May 28, 2024
1 parent f656ba5 commit b587f7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/eval-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const snippets = {
EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes('euCookie'),
EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
EVAL_FIDES_DETECT_POPUP: () => window.Fides?.initialized,
EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
EVAL_HEMA_TEST_0: () => document.cookie.includes('cookies_rejected=1'),
EVAL_IUBENDA_0: () => document.querySelectorAll('.purposes-item input[type=checkbox]:not([disabled])').forEach(x => {if(x.checked) x.click()}) || true,
Expand Down
7 changes: 5 additions & 2 deletions rules/autoconsent/fides.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@
"detectPopup": [
{
"visible": "#fides-overlay #fides-banner"
},
{
"eval": "EVAL_FIDES_DETECT_POPUP"
}
],
"optIn": [
{
"waitForThenClick": "#fides-banner [data-testid=\"Accept all-btn\"]"
"waitForThenClick": "#fides-banner .fides-accept-all-button"
}
],
"optOut": [
{
"waitForThenClick": "#fides-banner [data-testid=\"Reject all-btn\"]"
"waitForThenClick": "#fides-banner .fides-reject-all-button"
}
]
}
1 change: 1 addition & 0 deletions tests/fides.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ import generateCMPTests from "../playwright/runner";

generateCMPTests('fides', [
'https://www.nytimes.com/',
'https://vercel.com/',
]);

0 comments on commit b587f7e

Please sign in to comment.