update tests for CI/CD
This commit is contained in:
@@ -48,9 +48,7 @@ jobs:
|
|||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: pnpm install --frozen-lockfile
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
cd job-application-demo && pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Run demo unit tests
|
- name: Run demo unit tests
|
||||||
run: cd job-application-demo && pnpm test -- --run --reporter=verbose
|
run: cd job-application-demo && pnpm test -- --run --reporter=verbose
|
||||||
@@ -74,9 +72,7 @@ jobs:
|
|||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: pnpm install --frozen-lockfile
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
cd job-application-demo && pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Install Playwright browsers
|
- name: Install Playwright browsers
|
||||||
run: cd job-application-demo && npx playwright install --with-deps chromium firefox
|
run: cd job-application-demo && npx playwright install --with-deps chromium firefox
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ describe('App', () => {
|
|||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(
|
expect(
|
||||||
screen.getByText(/please fill in all required personal information/i)
|
screen.getByText(/please fill in all required personal information fields/i)
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -147,9 +147,8 @@ describe('App', () => {
|
|||||||
await user.click(submitButton);
|
await user.click(submitButton);
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(
|
const alert = screen.getByRole('alert');
|
||||||
screen.getByText(/please add at least one skill/i)
|
expect(alert).toHaveTextContent(/please add at least one skill/i);
|
||||||
).toBeInTheDocument();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ function App() {
|
|||||||
Fields marked with * are required
|
Fields marked with * are required
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Box component="form" onSubmit={handleSubmit}>
|
<Box component="form" onSubmit={handleSubmit} noValidate>
|
||||||
<PersonalInfoForm
|
<PersonalInfoForm
|
||||||
data={formData.personalInfo}
|
data={formData.personalInfo}
|
||||||
onChange={(personalInfo) =>
|
onChange={(personalInfo) =>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vitest/config';
|
||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
|
packages:
|
||||||
|
- 'job-application-demo'
|
||||||
|
|
||||||
onlyBuiltDependencies:
|
onlyBuiltDependencies:
|
||||||
- esbuild
|
- esbuild
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ export default defineConfig({
|
|||||||
test: {
|
test: {
|
||||||
globals: true,
|
globals: true,
|
||||||
environment: 'jsdom',
|
environment: 'jsdom',
|
||||||
|
exclude: [
|
||||||
|
'**/node_modules/**',
|
||||||
|
'**/dist/**',
|
||||||
|
'**/job-application-demo/**',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
Reference in New Issue
Block a user