From f64a6bf8f509cd81a577bc6fc307b2c7ac7bfed5 Mon Sep 17 00:00:00 2001 From: Nicholas Cunningham Date: Thu, 4 Apr 2024 12:16:26 -0600 Subject: [PATCH] fix(nextjs): Enable failing storybook tests --- .nx/workflows/agents.yaml | 2 +- e2e/next-extensions/src/next-storybook.test.ts | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 419637500ea0f4..e55f1f8c406021 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -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 - name: Install Pnpm script: | npm install -g pnpm@8.15.5 diff --git a/e2e/next-extensions/src/next-storybook.test.ts b/e2e/next-extensions/src/next-storybook.test.ts index 866fe445357611..53a2a26b5c38d0 100644 --- a/e2e/next-extensions/src/next-storybook.test.ts +++ b/e2e/next-extensions/src/next-storybook.test.ts @@ -1,26 +1,27 @@ 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` ); }); @@ -28,7 +29,7 @@ xdescribe('Next.js Storybook', () => { 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`);