fix(nextjs): enable failing storybook tests (#22675)

This commit is contained in:
Nicholas Cunningham 2024-06-06 08:42:32 -06:00 committed by GitHub
parent 7b1073ebb5
commit cfcedb481a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 8 deletions

View File

@ -94,7 +94,7 @@ jobs:
- run: - run:
command: | command: |
sudo apt-get update 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-chrome
- run-pnpm-install: - run-pnpm-install:
os: linux os: linux

View File

@ -25,7 +25,7 @@ launch-templates:
- name: Install e2e deps - name: Install e2e deps
script: | script: |
sudo apt-get update 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 - name: Install Pnpm
script: | script: |
npm install -g pnpm@8 npm install -g pnpm@8

View File

@ -6,21 +6,19 @@ import {
uniq, uniq,
} from '@nx/e2e/utils'; } from '@nx/e2e/utils';
// TODO(katerina): Enable some time? describe('Next.js Storybook', () => {
// This test fails because of sharp. In this PR I have included all related links to the issue.
xdescribe('Next.js Storybook', () => {
const appName = uniq('app'); const appName = uniq('app');
beforeAll(() => { beforeAll(() => {
newProject({ newProject({
name: 'proj', name: 'proj',
packageManager: 'npm', packageManager: 'npm',
packages: ['@nx/next'], packages: ['@nx/next', '@nx/react'],
}); });
runCLI( runCLI(
`generate @nx/next:app ${appName} --e2eTestRunner=none --project-name-and-root-format=as-provided --no-interactive` `generate @nx/next:app ${appName} --e2eTestRunner=none --project-name-and-root-format=as-provided --no-interactive`
); );
runCLI( 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`
); );
}); });
@ -28,7 +26,7 @@ xdescribe('Next.js Storybook', () => {
it('should run a Next.js based Storybook setup', async () => { it('should run a Next.js based Storybook setup', async () => {
runCLI( runCLI(
`generate @nx/next:storybook-configuration ${appName} --generateStories --no-interactive` `generate @nx/react:storybook-configuration ${appName} --no-interactive`
); );
runCLI(`build-storybook ${appName}`); runCLI(`build-storybook ${appName}`);
checkFilesExist(`${appName}/storybook-static/index.html`); checkFilesExist(`${appName}/storybook-static/index.html`);