import { forEachCli, runCLI, supportUi, uniq, ensureProject, tmpProjPath, checkFilesExist, readFile, } from './utils'; import { writeFileSync, mkdirSync } from 'fs'; forEachCli(() => { describe('Storybook schematics', () => { describe('running Storybook and Cypress', () => { it('should execute e2e tests using Cypress running against Storybook', () => { ensureProject(); const myapp = uniq('myapp'); runCLI(`generate @nrwl/angular:app ${myapp} --no-interactive`); const mylib = uniq('test-ui-lib'); createTestUILib(mylib); const mylib2 = uniq('test-ui-lib-react'); runCLI(`generate @nrwl/react:lib ${mylib2} --no-interactive`); runCLI( `generate @nrwl/react:component Button --project=${mylib2} --no-interactive` ); writeFileSync( tmpProjPath(`libs/${mylib2}/src/lib/button.tsx`), ` import React from 'react'; import './button.css'; export type ButtonStyle = 'default' | 'primary' | 'warning'; /* eslint-disable-next-line */ export interface ButtonProps { text?: string; style?: ButtonStyle; padding?: number; } export const Button = (props: ButtonProps) => { return ( ); }; export default Button; ` ); writeFileSync( tmpProjPath(`libs/${mylib2}/src/lib/button.stories.tsx`), ` import React from 'react'; import { text, number } from '@storybook/addon-knobs'; import { Button, ButtonStyle } from './button'; export default { title: 'Button' }; export const primary = () => (

You are {{age}} years old.

` ); runCLI( `g @nrwl/angular:component test-other --project=${libName} --no-interactive` ); }