Download wp-calypso/client/state/email-accounts/test/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 874 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/email-accounts/test/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/email-accounts/test/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/email-accounts/test/reducer.js
874 Bytes
| import { EMAIL_ACCOUNTS_REQUEST_SUCCESS } from 'calypso/state/action-types'; | |
| import { emailAccountsReducer } from '../reducer'; | |
| describe( "emailAccountsReducer's", () => { | |
| const account = { | |
| domain_name: 'test.blog', | |
| product_name: 'G Suite Basic', | |
| product_slug: 'gapps', | |
| product_type: 'gapps', | |
| site_id: 1, | |
| mailboxes: [ | |
| { | |
| name: 'user', | |
| first_name: 'User', | |
| last_name: 'One', | |
| state: 'suspended', | |
| }, | |
| ], | |
| }; | |
| describe( 'accounts sub-reducer', () => { | |
| test( 'should default to null', () => { | |
| const state = emailAccountsReducer( undefined, {} ); | |
| expect( state ).toBeNull(); | |
| } ); | |
| test( 'should return new items received', () => { | |
| const state = emailAccountsReducer( null, { | |
| type: EMAIL_ACCOUNTS_REQUEST_SUCCESS, | |
| response: { accounts: [ account ] }, | |
| } ); | |
| expect( state ).toEqual( [ account ] ); | |
| } ); | |
| } ); | |
| } ); | |