Skip to content

Commit

Permalink
Add gift-article test to test sharing options toggler when isMPRArtic…
Browse files Browse the repository at this point in the history
…le is true
  • Loading branch information
AnnaDraganova committed Jan 8, 2025
1 parent d64f1a1 commit ff4ea30
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/x-gift-article/__tests__/x-gift-article.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,20 @@ describe('x-gift-article', () => {
expect(subject.find('#free-article-alert')).toExist()
expect(subject.find('#share-with-non-subscribers-checkbox')).not.toExist()
})

it('should hide the Sharing options toggler when isMPRArticle is true', async () => {
const args = {
...baseArgs,
isMPRArticle: true
}
const subject = mount(<ShareArticleModal {...args} actionsRef={(a) => Object.assign(actions, a)} />)

await actions.activate()

subject.update()

expect(subject.find({ children: 'FT subscribers only' })).not.toExist()
expect(subject.find({ children: 'Anyone' })).not.toExist()
expect(subject.find({ children: 'Non-subscriber' })).not.toExist()
})
})

0 comments on commit ff4ea30

Please sign in to comment.