Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

232 form field component #299

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
test-setup file added to import matchers and globals
  • Loading branch information
MMeijerink committed Oct 9, 2024
commit 088acb8afab1b010fc23fec02069c811dc92df22
2 changes: 2 additions & 0 deletions packages/components-react/jest-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '@testing-library/jest-dom/matchers';
import '@testing-library/jest-dom/jest-globals';
1 change: 1 addition & 0 deletions packages/components-react/jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const customJestConfig = {
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
testPathIgnorePatterns: ['/dist/'],
setupFilesAfterEnv: ['./jest-setup.ts'],
// transformIgnorePatterns: ['node_modules/(?!@utrecht/web-component-library-react)'],
};

Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/src/heading/Heading.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { describe, expect, it } from '@jest/globals';
import { render, screen } from '@testing-library/react';
import React from 'react';
import { LuxHeading, LuxHeading1, LuxHeading2, LuxHeading3, LuxHeading4, LuxHeading5, LuxHeading6 } from './Heading';

describe('Dynamic Heading', () => {
Expand Down Expand Up @@ -70,6 +69,7 @@ describe('Dynamic Heading', () => {
});

it('can should fall back to level 6 when the level is outside of the heading range', () => {
/* @ts-ignore */
render(<LuxHeading level={8}>Lux Heading</LuxHeading>);
const heading = screen.getByRole('heading', {
name: 'Lux Heading',
Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"noEmit": true,
"types": ["@testing-library/jest-dom"]
},
"include": ["next-env.d.ts", "src/**/*.test.ts", "src/**/*.test.tsx"],
"include": ["next-env.d.ts", "src/**/*.test.ts", "src/**/*.test.tsx", "./jest-setup.ts"],
"exclude": ["**/node_modules/*"]
}