Skip to content

Commit

Permalink
fix(storybook): enable e2e tests and use v7
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Mar 16, 2023
1 parent c690461 commit c3558fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 39 deletions.
36 changes: 0 additions & 36 deletions e2e/storybook-angular/src/storybook-angular.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,42 +46,6 @@ describe('Storybook for Angular', () => {

afterAll(() => cleanupProject());

it('should not overwrite global storybook config files', () => {
const angularStorybookLib = uniq('test-ui-lib-angular');
runCLI(
`generate @nrwl/angular:lib ${angularStorybookLib} --no-interactive`
);
runCLI(
`generate @nrwl/angular:storybook-configuration ${angularStorybookLib} --generateStories --no-interactive`
);

checkFilesExist(`.storybook/main.js`);
writeFileSync(
tmpProjPath(`.storybook/main.js`),
`
module.exports = {
stories: [],
addons: ['@storybook/addon-essentials'],
};
console.log('hi there');
`
);

// generate another lib with storybook config
const anotherAngularStorybookLib = uniq('test-ui-lib-angular2');
runCLI(
`generate @nrwl/angular:lib ${anotherAngularStorybookLib} --no-interactive`
);
runCLI(
`generate @nrwl/angular:storybook-configuration ${anotherAngularStorybookLib} --generateStories --no-interactive`
);

expect(readFile(`.storybook/main.js`)).toContain(
`console.log('hi there');`
);
});

describe('build storybook', () => {
let angularStorybookLib;

Expand Down
5 changes: 2 additions & 3 deletions e2e/storybook/src/storybook-nested.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ describe('Storybook generators for nested workspaces', () => {
it('should generate storybook files', () => {
checkFilesExist(
'.storybook/main.js',
'.storybook/main.root.js',
'.storybook/preview.js',
'.storybook/tsconfig.json'
);
Expand All @@ -77,8 +76,8 @@ describe('Storybook generators for nested workspaces', () => {
`generate @nrwl/react:storybook-configuration ${nestedAppName} --generateStories --no-interactive`
);
checkFilesExist(
`${nestedAppName}/.storybook/main.js`,
`${nestedAppName}/.storybook/tsconfig.json`
`apps/${nestedAppName}/.storybook/main.js`,
`apps/${nestedAppName}/.storybook/tsconfig.json`
);
});
});
Expand Down

0 comments on commit c3558fb

Please sign in to comment.