react-code-dataset / wp-calypso /client /landing /stepper /declarative-flow /helpers /test /index.ts
react-code-dataset / wp-calypso /client /landing /stepper /declarative-flow /helpers /test /index.ts
Download wp-calypso/client/landing/stepper/declarative-flow/helpers/test/index.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/declarative-flow/helpers/test/index.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/stepper/declarative-flow/helpers/test/index.ts
-
curl -L -o index.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/declarative-flow/helpers/test/index.ts
1.22 kB
| import { shouldRedirectToSiteMigration } from '..'; | |
| import { STEPS } from '../../internals/steps'; | |
| describe( 'DeclarativeFlowHelpers', () => { | |
| it( 'returns true when current step, platform and origin as set properly', () => { | |
| expect( | |
| shouldRedirectToSiteMigration( | |
| STEPS.IMPORT_LIST.slug, | |
| 'wordpress', | |
| STEPS.SITE_MIGRATION_IDENTIFY.slug | |
| ) | |
| ).toBe( true ); | |
| } ); | |
| it( 'returns false when current step is not importList', () => { | |
| expect( | |
| shouldRedirectToSiteMigration( 'other-step', 'wordpress', 'site-migration-identify' ) | |
| ).toBe( false ); | |
| } ); | |
| it( 'returns false when platform is not wordpress', () => { | |
| expect( | |
| shouldRedirectToSiteMigration( | |
| STEPS.IMPORT_LIST.slug, | |
| 'other-platform', | |
| STEPS.SITE_MIGRATION_IDENTIFY.slug | |
| ) | |
| ).toBe( false ); | |
| } ); | |
| it( 'returns false when the origin is not set', () => { | |
| expect( | |
| shouldRedirectToSiteMigration( | |
| STEPS.IMPORT_LIST.slug, | |
| STEPS.SITE_MIGRATION_IDENTIFY.slug, | |
| null | |
| ) | |
| ).toBe( false ); | |
| } ); | |
| it( 'returns false when the origin is not the site-migration-identify', () => { | |
| expect( | |
| shouldRedirectToSiteMigration( STEPS.IMPORT_LIST.slug, 'wordpress', 'other-origin' ) | |
| ).toBe( false ); | |
| } ); | |
| } ); | |