Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: place consents in appropriate section #434

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Account/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Account = ({ panelClassName, panelHeaderClassName, canUpdateEmail = true }
const nonTerms: Consent[] = [];

publisherConsents?.forEach((consent) => {
if (consent?.type === 'checkbox') {
if (!consent?.type || consent?.type === 'checkbox') {
terms.push(consent);
} else {
nonTerms.push(consent);
Expand Down
48 changes: 12 additions & 36 deletions src/components/Account/__snapshots__/Account.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -134,51 +134,27 @@ exports[`<Account> > renders and matches snapshot 1`] = `
account.terms_and_tracking
</h3>
</div>
<form
class="_flexBox_1c1c63"
novalidate=""
/>
<div
class="_controls_1c1c63"
/>
</div>
<div
class="panel-class"
>
<div
class="header-class"
>
<h3>
account.other_registration_details
</h3>
</div>
<form
class="_flexBox_1c1c63"
novalidate=""
>
<div
class="_customFields_c968f7"
data-testid="custom-reg-fields"
class="_checkbox_531f07"
>
<div
class="_checkbox_531f07"
data-testid="crf-undefined"
class="_row_531f07"
>
<div
class="_row_531f07"
<input
id="check-box_1235_consentsValues.marketing"
name="consentsValues.marketing"
type="checkbox"
value=""
/>
<label
for="check-box_1235_consentsValues.marketing"
>
<input
id="check-box_1235_consentsValues.marketing"
name="consentsValues.marketing"
type="checkbox"
value=""
/>
<label
for="check-box_1235_consentsValues.marketing"
>
Receive Marketing Emails
</label>
</div>
Receive Marketing Emails
</label>
</div>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion test-e2e/tests/account_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function runTestSuite(config: typeof testConfigs.svod, providerName: string, res
Scenario(`I can update my consents - ${providerName}`, async ({ I }) => {
I.amOnPage(constants.accountsUrl);
I.waitForText('Profile info', longTimeout);
I.scrollTo('//*[text() = "Other registration details"]');
I.scrollTo('//*[text() = "Legal & Marketing"]', undefined, -100);

I.dontSeeCheckboxIsChecked(consentCheckbox);
I.dontSee('Save');
Expand Down