Download wp-calypso/client/state/active-promotions/test/actions.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/active-promotions/test/actions.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/active-promotions/test/actions.js
-
curl -L -o actions.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/active-promotions/test/actions.js
1.29 kB
| import { | |
| activePromotionsReceiveAction, | |
| activePromotionsRequestSuccessAction, | |
| activePromotionsRequestFailureAction, | |
| requestActivePromotions, | |
| } from '../actions'; | |
| import { | |
| ACTION_ACTIVE_PROMOTIONS_RECEIVE, | |
| ACTION_ACTIVE_PROMOTIONS_REQUEST, | |
| ACTION_ACTIVE_PROMOTIONS_REQUEST_SUCCESS, | |
| ACTION_ACTIVE_PROMOTIONS_REQUEST_FAILURE, | |
| WPCOM_RESPONSE as wpcomResponse, | |
| ERROR_MESSAGE_RESPONSE as errorResponse, | |
| } from './fixture'; | |
| describe( 'actions', () => { | |
| describe( 'creators functions', () => { | |
| test( '#activePromotionsReceiveAction()', () => { | |
| const activePromotions = wpcomResponse; | |
| const action = activePromotionsReceiveAction( activePromotions ); | |
| expect( action ).toEqual( ACTION_ACTIVE_PROMOTIONS_RECEIVE ); | |
| } ); | |
| test( '#activePromotionsRequestSuccessAction()', () => { | |
| const action = activePromotionsRequestSuccessAction(); | |
| expect( action ).toEqual( ACTION_ACTIVE_PROMOTIONS_REQUEST_SUCCESS ); | |
| } ); | |
| test( '#activePromotionsRequestFailureAction()', () => { | |
| const action = activePromotionsRequestFailureAction( errorResponse ); | |
| expect( action ).toEqual( ACTION_ACTIVE_PROMOTIONS_REQUEST_FAILURE ); | |
| } ); | |
| test( '#requestActivePromotions()', () => { | |
| expect( requestActivePromotions() ).toEqual( ACTION_ACTIVE_PROMOTIONS_REQUEST ); | |
| } ); | |
| } ); | |
| } ); | |