Download wp-calypso/client/state/active-promotions/test/selectors.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/active-promotions/test/selectors.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/active-promotions/test/selectors.js
-
curl -L -o selectors.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/active-promotions/test/selectors.js
1.35 kB
| jest.mock( '@automattic/calypso-products', () => ( { | |
| ...jest.requireActual( '@automattic/calypso-products' ), | |
| GROUP_WPCOM: 'GROUP_WPCOM', | |
| GROUP_JETPACK: 'GROUP_JETPACK', | |
| TERM_MONTHLY: 'TERM_MONTHLY', | |
| TERM_ANNUALLY: 'TERM_ANNUALLY', | |
| TERM_BIENNIALLY: 'TERM_BIENNIALLY', | |
| TYPE_FREE: 'TYPE_FREE', | |
| TYPE_PERSONAL: 'TYPE_PERSONAL', | |
| TYPE_PREMIUM: 'TYPE_PREMIUM', | |
| TYPE_BUSINESS: 'TYPE_BUSINESS', | |
| ACTIVE_PROMOTIONS_LIST: { | |
| jetpack_premium_monthly: { | |
| term: 'TERM_MONTHLY', | |
| }, | |
| value_bundle: { | |
| term: 'TERM_ANNUALLY', | |
| }, | |
| 'personal-bundle-2y': { | |
| term: 'TERM_BIENNIALLY', | |
| }, | |
| }, | |
| } ) ); | |
| import { getActivePromotions, isRequestingActivePromotions } from '../selectors'; | |
| import { ACTIVE_PROMOTIONS, getStateInstance } from './fixture'; | |
| describe( 'selectors', () => { | |
| describe( '#getActivePromotions()', () => { | |
| test( 'should return WordPress ActivePromotions array', () => { | |
| const state = getStateInstance(); | |
| const activePromotions = getActivePromotions( state ); | |
| expect( activePromotions ).toEqual( ACTIVE_PROMOTIONS ); | |
| } ); | |
| } ); | |
| describe( '#isRequestingActivePromotions()', () => { | |
| test( 'should return requesting state of ActivePromotions', () => { | |
| const state = getStateInstance(); | |
| const isRequesting = isRequestingActivePromotions( state ); | |
| expect( isRequesting ).toEqual( false ); | |
| } ); | |
| } ); | |
| } ); | |