-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1363 from Automattic/remove/themes-flux-stores
Themes: Remove Flux stores
- Loading branch information
Showing
17 changed files
with
272 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { expect } from 'chai'; | ||
import { createStore } from 'redux'; | ||
|
||
import ThemeConstants from '../constants'; | ||
import reducer from '../reducers/current-theme'; | ||
|
||
describe( 'current-theme', () => { | ||
const SITE = { ID: 77203074 }; // dummy id | ||
|
||
const actionReceiveCurrentTheme = { | ||
type: ThemeConstants.RECEIVE_CURRENT_THEME, | ||
themeId: 'twentyfifteen', | ||
themeName: 'Twenty Fifteen', | ||
site: SITE | ||
}; | ||
|
||
let store; | ||
|
||
function getCurrentTheme( siteId ) { | ||
return store.getState().get( 'currentThemes' ).get( siteId ); | ||
} | ||
|
||
beforeEach( () => { | ||
store = createStore( reducer ); | ||
} ); | ||
|
||
describe( 'get()', () => { | ||
beforeEach( () => { | ||
store.dispatch( actionReceiveCurrentTheme ); | ||
} ); | ||
|
||
it( 'returns the current theme for the supplied site id', () => { | ||
const currentTheme = getCurrentTheme( SITE.ID ); | ||
|
||
expect( currentTheme.id ).to.equal( 'twentyfifteen' ); | ||
expect( currentTheme.name ).to.equal( 'Twenty Fifteen' ); | ||
} ); | ||
} ); | ||
} ); |
Oops, something went wrong.