From f666694f9b264d2d9cf5a2e281494114590fa944 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Sun, 19 Oct 2025 19:13:22 -0500 Subject: [PATCH] update tests for CI/CD --- .github/workflows/status-checks.yml | 8 ++------ job-application-demo/src/App.test.tsx | 7 +++---- job-application-demo/src/App.tsx | 2 +- job-application-demo/vite.config.ts | 2 +- pnpm-workspace.yaml | 3 +++ vitest.config.ts | 5 +++++ 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/status-checks.yml b/.github/workflows/status-checks.yml index ed58a45..77adc70 100644 --- a/.github/workflows/status-checks.yml +++ b/.github/workflows/status-checks.yml @@ -48,9 +48,7 @@ jobs: cache: 'pnpm' - name: Install dependencies - run: | - pnpm install --frozen-lockfile - cd job-application-demo && pnpm install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Run demo unit tests run: cd job-application-demo && pnpm test -- --run --reporter=verbose @@ -74,9 +72,7 @@ jobs: cache: 'pnpm' - name: Install dependencies - run: | - pnpm install --frozen-lockfile - cd job-application-demo && pnpm install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Install Playwright browsers run: cd job-application-demo && npx playwright install --with-deps chromium firefox diff --git a/job-application-demo/src/App.test.tsx b/job-application-demo/src/App.test.tsx index 251c31a..c54a228 100644 --- a/job-application-demo/src/App.test.tsx +++ b/job-application-demo/src/App.test.tsx @@ -77,7 +77,7 @@ describe('App', () => { await waitFor(() => { expect( - screen.getByText(/please fill in all required personal information/i) + screen.getByText(/please fill in all required personal information fields/i) ).toBeInTheDocument(); }); }); @@ -147,9 +147,8 @@ describe('App', () => { await user.click(submitButton); await waitFor(() => { - expect( - screen.getByText(/please add at least one skill/i) - ).toBeInTheDocument(); + const alert = screen.getByRole('alert'); + expect(alert).toHaveTextContent(/please add at least one skill/i); }); }); diff --git a/job-application-demo/src/App.tsx b/job-application-demo/src/App.tsx index f85102c..66667f6 100644 --- a/job-application-demo/src/App.tsx +++ b/job-application-demo/src/App.tsx @@ -139,7 +139,7 @@ function App() { Fields marked with * are required - + diff --git a/job-application-demo/vite.config.ts b/job-application-demo/vite.config.ts index 82f5b74..17e8237 100644 --- a/job-application-demo/vite.config.ts +++ b/job-application-demo/vite.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from 'vite'; +import { defineConfig } from 'vitest/config'; import react from '@vitejs/plugin-react'; // https://vite.dev/config/ diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index efc037a..76b327a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,5 @@ +packages: + - 'job-application-demo' + onlyBuiltDependencies: - esbuild diff --git a/vitest.config.ts b/vitest.config.ts index 8969526..85fc60f 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -8,6 +8,11 @@ export default defineConfig({ test: { globals: true, environment: 'jsdom', + exclude: [ + '**/node_modules/**', + '**/dist/**', + '**/job-application-demo/**', + ], }, resolve: { alias: {