From c6a7a45dfb1e176101ff1f814fb482f93c2c6fb2 Mon Sep 17 00:00:00 2001 From: Alessandro Vito Date: Tue, 5 Oct 2021 17:36:36 +0100 Subject: [PATCH] ADSDEV-924 test that ad is inserted under the correct blog post --- .../src/__tests__/LiveBlogWrapper.test.jsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/components/x-live-blog-wrapper/src/__tests__/LiveBlogWrapper.test.jsx b/components/x-live-blog-wrapper/src/__tests__/LiveBlogWrapper.test.jsx index 9557f849c..6e876c475 100644 --- a/components/x-live-blog-wrapper/src/__tests__/LiveBlogWrapper.test.jsx +++ b/components/x-live-blog-wrapper/src/__tests__/LiveBlogWrapper.test.jsx @@ -26,6 +26,14 @@ const post2 = { showShareButtons: true } +const ads = { + 1: ( +
+ Ads +
+ ) +} + describe('x-live-blog-wrapper', () => { it('has a displayName', () => { expect(LiveBlogWrapper.displayName).toContain('BaseLiveBlogWrapper') @@ -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() + + const articles = liveBlogWrapper.find('article') + expect(articles.at(0).html()).not.toContain('Ads') + expect(articles.at(1).html()).toContain('Ads') + }) }) describe('liveBlogWrapperActions', () => {