Fix dataset check in JS (#20733)
* Fix dataset check in JS * Email opt in quick fix * Change test
This commit is contained in:
parent
751e9d70d2
commit
f263e17a1f
2 changed files with 3 additions and 4 deletions
|
|
@ -13,8 +13,7 @@ export class FollowTags extends Component {
|
|||
this.handleComplete = this.handleComplete.bind(this);
|
||||
|
||||
const emailState =
|
||||
document.body.dataset.defaultEmailOptinAllowed === 'true';
|
||||
|
||||
document.body.dataset.default_email_optin_allowed === 'true';
|
||||
this.state = {
|
||||
allTags: [],
|
||||
selectedTags: [],
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ describe('FollowTags', () => {
|
|||
describe('emailDigestPeriodic state initialization', () => {
|
||||
it('should initialize email_digest_periodic to true when data-default-email-optin-allowed is true', async () => {
|
||||
// Simulate setting data-default-email-optin-allowed to true
|
||||
document.body.dataset.defaultEmailOptinAllowed = 'true';
|
||||
document.body.dataset.default_email_optin_allowed = 'true';
|
||||
|
||||
const { container } = renderFollowTags();
|
||||
const checkbox = container.querySelector('#email_digest_periodic');
|
||||
|
|
@ -246,7 +246,7 @@ describe('FollowTags', () => {
|
|||
|
||||
it('should initialize email_digest_periodic to false when data-default-email-optin-allowed is false', async () => {
|
||||
// Simulate setting data-default-email-optin-allowed to false
|
||||
document.body.dataset.defaultEmailOptinAllowed = 'false';
|
||||
document.body.dataset.default_email_optin_allowed = 'false';
|
||||
|
||||
const { container } = renderFollowTags();
|
||||
const checkbox = container.querySelector('#email_digest_periodic');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue