0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Added data test attributes (#15981)

refs TryGhost/Team#2371
This commit is contained in:
Elena Baidakova 2022-12-12 10:23:13 +04:00 committed by GitHub
parent 88b056dc86
commit 8b92b49363
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -48,7 +48,7 @@ function NewsletterPrefSection({newsletter, subscribedNewsletters, setSubscribed
const [showUpdated, setShowUpdated] = useState(false);
const [timeoutId, setTimeoutId] = useState(null);
return (
<section className='gh-portal-list-toggle-wrapper'>
<section className='gh-portal-list-toggle-wrapper' data-test-toggle-wrapper>
<div className='gh-portal-list-detail'>
<h3>{newsletter.name}</h3>
<p>{newsletter?.description}</p>
@ -96,7 +96,7 @@ function CommentsSection({updateCommentNotifications, isCommentsEnabled, enableC
}
return (
<section className='gh-portal-list-toggle-wrapper'>
<section className='gh-portal-list-toggle-wrapper' data-test-toggle-wrapper>
<div className='gh-portal-list-detail'>
<h3>Comments</h3>
<p>Get notified when someone replies to your comment</p>
@ -175,7 +175,7 @@ export default function NewsletterManagement({
updateSubscribedNewsletters(newsletters);
}}
/>
<CommentsSection
<CommentsSection
isCommentsEnabled={isCommentsEnabled}
enableCommentNotifications={enableCommentNotifications}
updateCommentNotifications={updateCommentNotifications}
@ -195,6 +195,7 @@ export default function NewsletterManagement({
label='Unsubscribe from all emails'
isDestructive={true}
style={{width: '100%'}}
dataTestId="unsubscribe-from-all-emails"
/>
<ShowPaidMemberMessage isPaid={isPaidMember} site={site} />
</div>

View file

@ -80,7 +80,7 @@ function Switch({id, label = '', onToggle, checked = false, dataTestId = 'switch
setIsChecked(checked);
}, [checked, isActionChanged]);
return (
<div className="gh-portal-for-switch">
<div className="gh-portal-for-switch" data-test-switch={dataTestId}>
<label className="switch" htmlFor={id}>
<input
type="checkbox"

View file

@ -13,7 +13,7 @@ function NewsletterPrefSection({newsletter, subscribedNewsletters, setSubscribed
});
if (newsletter.paid) {
return (
<section className='gh-portal-list-toggle-wrapper'>
<section className='gh-portal-list-toggle-wrapper' data-test-toggle-wrapper>
<div className='gh-portal-list-detail gh-portal-list-big'>
<h3>{newsletter.name}</h3>
<p>{newsletter.description}</p>
@ -25,7 +25,7 @@ function NewsletterPrefSection({newsletter, subscribedNewsletters, setSubscribed
);
}
return (
<section className='gh-portal-list-toggle-wrapper'>
<section className='gh-portal-list-toggle-wrapper' data-test-toggle-wrapper>
<div className='gh-portal-list-detail gh-portal-list-big'>
<h3>{newsletter.name}</h3>
<p>{newsletter.description}</p>