Skip to content

Commit

Permalink
ADSDEV-924 test that ad is inserted under the correct blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
alevito committed Oct 5, 2021
1 parent bbd5085 commit c6a7a45
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ const post2 = {
showShareButtons: true
}

const ads = {
1: (
<div className="o-ads" data-o-ads-name="mid1">
Ads
</div>
)
}

describe('x-live-blog-wrapper', () => {
it('has a displayName', () => {
expect(LiveBlogWrapper.displayName).toContain('BaseLiveBlogWrapper')
Expand All @@ -49,6 +57,15 @@ describe('x-live-blog-wrapper', () => {
expect(articles.at(0).html()).toContain('Post 2 Title')
expect(articles.at(1).html()).toContain('Post 1 Title')
})

it('renders an ad slot element at the given position', () => {
const posts = [post1, post2]
const liveBlogWrapper = mount(<LiveBlogWrapper posts={posts} ads={ads} />)

const articles = liveBlogWrapper.find('article')
expect(articles.at(0).html()).not.toContain('Ads')
expect(articles.at(1).html()).toContain('Ads')
})
})

describe('liveBlogWrapperActions', () => {
Expand Down

0 comments on commit c6a7a45

Please sign in to comment.