From 0e5c01727a5edc04c38e9493b94455b6b65b9a6d Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Mon, 1 May 2017 14:15:29 +0300 Subject: [PATCH] State: Fix some more failing tests --- client/state/posts/test/selectors.js | 5 +++- .../test/are-all-sites-single-user.js | 10 ++++++-- client/state/selectors/test/get-sites.js | 5 +++- .../state/selectors/test/get-visible-sites.js | 5 +++- client/state/sites/plans/test/selectors.js | 5 +++- client/state/sites/test/enhancer.js | 5 +++- client/state/sites/test/selectors.js | 25 +++++++++++++++---- client/state/ui/test/selectors.js | 3 +++ 8 files changed, 51 insertions(+), 12 deletions(-) diff --git a/client/state/posts/test/selectors.js b/client/state/posts/test/selectors.js index d3a393370d6c4..3b6929f8fca85 100644 --- a/client/state/posts/test/selectors.js +++ b/client/state/posts/test/selectors.js @@ -1406,7 +1406,10 @@ describe( 'selectors', () => { } } } - } + }, + siteSettings: { + items: {}, + }, }, 2916284, 841 ); expect( previewUrl ).to.equal( 'https://example.wordpress.com/post-url' ); diff --git a/client/state/selectors/test/are-all-sites-single-user.js b/client/state/selectors/test/are-all-sites-single-user.js index f5848393044dd..ea6c80af1f9ce 100644 --- a/client/state/selectors/test/are-all-sites-single-user.js +++ b/client/state/selectors/test/are-all-sites-single-user.js @@ -33,7 +33,10 @@ describe( 'areAllSitesSingleUser()', () => { single_user_site: false } } - } + }, + siteSettings: { + items: {}, + }, }; const allAreSingleUser = areAllSitesSingleUser( state ); @@ -53,7 +56,10 @@ describe( 'areAllSitesSingleUser()', () => { single_user_site: true } } - } + }, + siteSettings: { + items: {}, + }, }; const allAreSingleUser = areAllSitesSingleUser( state ); diff --git a/client/state/selectors/test/get-sites.js b/client/state/selectors/test/get-sites.js index f790c17af3baa..da2e0ec5f976d 100644 --- a/client/state/selectors/test/get-sites.js +++ b/client/state/selectors/test/get-sites.js @@ -42,7 +42,10 @@ describe( 'getSites()', () => { } } } - } + }, + siteSettings: { + items: {}, + }, }; const sites = getSites( state ); expect( sites ).to.have.length( 2 ); diff --git a/client/state/selectors/test/get-visible-sites.js b/client/state/selectors/test/get-visible-sites.js index f1c4805401a65..9823a1884b7ec 100644 --- a/client/state/selectors/test/get-visible-sites.js +++ b/client/state/selectors/test/get-visible-sites.js @@ -42,7 +42,10 @@ describe( 'getVisibleSites()', () => { } } } - } + }, + siteSettings: { + items: {}, + }, }; const sites = getVisibleSites( state ); expect( sites ).to.eql( [ diff --git a/client/state/sites/plans/test/selectors.js b/client/state/sites/plans/test/selectors.js index a7bd2b7a685c3..29f49d71769c8 100644 --- a/client/state/sites/plans/test/selectors.js +++ b/client/state/sites/plans/test/selectors.js @@ -116,7 +116,10 @@ describe( 'selectors', () => { URL: 'https://example.wordpress.com' } } - } + }, + siteSettings: { + items: {}, + }, } ); it( 'returns a new sitePlanObject', () => { diff --git a/client/state/sites/test/enhancer.js b/client/state/sites/test/enhancer.js index b97f6000790bb..6da5eb4a88efc 100644 --- a/client/state/sites/test/enhancer.js +++ b/client/state/sites/test/enhancer.js @@ -26,7 +26,10 @@ const EXAMPLE_SITE = { describe( 'sitesSync()', () => { let sitesListFactory, Site, store, sitesList; - const state = { sites: { items: {} } }; + const state = { + sites: { items: {} }, + siteSettings: { items: {} }, + }; useFakeDom(); diff --git a/client/state/sites/test/selectors.js b/client/state/sites/test/selectors.js index 1708445f01b4b..da1ce48bfba77 100644 --- a/client/state/sites/test/selectors.js +++ b/client/state/sites/test/selectors.js @@ -94,7 +94,10 @@ describe( 'selectors', () => { } } } - } + }, + siteSettings: { + items: {}, + }, }, 2916284 ); expect( site ).to.eql( { @@ -138,7 +141,10 @@ describe( 'selectors', () => { } } } - } + }, + siteSettings: { + items: {}, + }, }, 2916284 ); expect( siteOptions ).to.eql( { @@ -162,7 +168,10 @@ describe( 'selectors', () => { } } } - } + }, + siteSettings: { + items: {}, + }, }, 2916284 ); expect( siteOptions ).to.eql( { @@ -258,7 +267,10 @@ describe( 'selectors', () => { items: { 77203074: { ID: 77203074, URL: 'https://example.wordpress.com', single_user_site: true } } - } + }, + siteSettings: { + items: {}, + }, }, 77203074 ); expect( singleUserSite ).to.be.true; @@ -270,7 +282,10 @@ describe( 'selectors', () => { items: { 77203074: { ID: 77203074, URL: 'https://example.wordpress.com', single_user_site: false } } - } + }, + siteSettings: { + items: {}, + }, }, 77203074 ); expect( singleUserSite ).to.be.false; diff --git a/client/state/ui/test/selectors.js b/client/state/ui/test/selectors.js index eb1e4ccdf35e3..026f9075d9212 100644 --- a/client/state/ui/test/selectors.js +++ b/client/state/ui/test/selectors.js @@ -37,6 +37,9 @@ describe( 'selectors', () => { 2916284: { ID: 2916284, name: 'WordPress.com Example Blog', URL: 'https://example.com' } } }, + siteSettings: { + items: {}, + }, ui: { selectedSiteId: 2916284 }