Skip to content

Commit

Permalink
fix(nextjs): Enable failing storybook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ndcunningham committed Jun 4, 2024
1 parent 640c61d commit f48983d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
- run:
command: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- install-sdkman
Expand Down
2 changes: 1 addition & 1 deletion .nx/workflows/agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ launch-templates:
- name: Install e2e deps
script: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Install Pnpm
script: |
npm install -g [email protected]
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions e2e/next-extensions/src/next-storybook.test.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
import {
checkFilesExist,
cleanupProject,
getPackageManagerCommand,
newProject,
runCLI,
tmpProjPath,
uniq,
} from '@nx/e2e/utils';
import { execSync } from 'node:child_process';

// TODO(katerina): Enable some time?
// This test fails because of sharp. In this PR I have included all related links to the issue.
xdescribe('Next.js Storybook', () => {
describe('Next.js Storybook', () => {
const appName = uniq('app');
beforeAll(() => {
newProject({
name: 'proj',
packageManager: 'npm',
packages: ['@nx/next'],
packages: ['@nx/next', '@nx/react'],
});
runCLI(
`generate @nx/next:app ${appName} --e2eTestRunner=none --project-name-and-root-format=as-provided --no-interactive`
);
runCLI(
`generate @nx/next:component Foo --directory=${appName}/components/foo/Foo.tsx --no-interactive`
`generate @nx/next:component foo --directory=${appName}/components/foo --nameAndDirectoryFormat=as-provided --no-interactive`
);
});

afterAll(() => cleanupProject());

it('should run a Next.js based Storybook setup', async () => {
runCLI(
`generate @nx/next:storybook-configuration ${appName} --generateStories --no-interactive`
`generate @nx/react:storybook-configuration ${appName} --no-interactive`
);
runCLI(`build-storybook ${appName}`);
checkFilesExist(`${appName}/storybook-static/index.html`);
Expand Down

0 comments on commit f48983d

Please sign in to comment.