Skip to content

Commit

Permalink
Adjust tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
budzanowski committed Dec 12, 2016
1 parent b57f3db commit f9aebea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions client/state/themes/test/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,38 +661,38 @@ describe( 'actions', () => {
} );

it( 'should dispatch install theme request action when triggered', () => {
installWpcomThemeOnJetpack( 'jetpackenabledsite.com', 'karuna' )( spy );
installWpcomThemeOnJetpack( 'jetpackenabledsite.com', 'karuna-wpcom' )( spy );

expect( spy ).to.have.been.calledWith( {
type: THEME_INSTALL_ON_JETPACK_REQUEST,
siteId: 'jetpackenabledsite.com',
themeId: 'karuna'
wpcomThemeId: 'karuna-wpcom'
} );
} );

it( 'should dispatch wpcom theme install request success action when request completes', () => {
return installWpcomThemeOnJetpack( 'jetpackenabledsite.com', 'karuna' )( spy ).then( () => {
return installWpcomThemeOnJetpack( 'jetpackenabledsite.com', 'karuna-wpcom' )( spy ).then( () => {
expect( spy ).to.have.been.calledWith( {
type: THEME_INSTALL_ON_JETPACK_REQUEST_SUCCESS,
siteId: 'jetpackenabledsite.com',
themeId: 'karuna',
wpcomThemeId: 'karuna-wpcom',
} );
} );
} );

it( 'should dispatch wpcom theme install request failure action when theme was not found', () => {
return installWpcomThemeOnJetpack( 'jetpackenabledsite.com', 'typist' )( spy ).then( () => {
installWpcomThemeOnJetpack( 'jetpackenabledsite.com', 'typist-wpcom' )( spy ).then( () => {
expect( spy ).to.have.been.calledWith( {
type: THEME_INSTALL_ON_JETPACK_REQUEST_FAILURE,
siteId: 'jetpackenabledsite.com',
themeId: 'typist',
wpcomThemeId: 'typist-wpcom',
error: sinon.match( { message: 'Problem downloading theme' } ),
} );
} );
} );

it( 'should dispatch wpcom theme install request failure action when theme is already installed', () => {
return installWpcomThemeOnJetpack( 'jetpackenabledsite.com', 'pinboard' )( spy ).then( () => {
installWpcomThemeOnJetpack( 'jetpackenabledsite.com', 'pinboard-wpcom' )( spy ).then( () => {
expect( spy ).to.have.been.calledWith( {
type: THEME_INSTALL_ON_JETPACK_REQUEST_FAILURE,
siteId: 'jetpackenabledsite.com',
Expand Down

0 comments on commit f9aebea

Please sign in to comment.