Skip to content

Commit c296bd2

Browse files
Feat/unit tests (#16)
* feat: Unit test setup * test: Add unit tests for TableRow, Pagination, and TableHeader components - Introduced unit tests for TableRow component, covering rendering, expansion, and custom rendering. - Added tests for Pagination component, validating navigation and page size changes. - Implemented tests for TableHeader component, ensuring correct rendering and filtering functionality. - Included necessary imports and mock data for testing. * feat: Add unit tests for SortType and defaultTheme - Introduced unit tests for the SortType enum, verifying its values and count. - Added tests for the defaultTheme structure, ensuring it contains the correct properties and valid configuration values for colors, table, pagination, and expand icon. - Updated vitest configuration to include test files with .ts and .tsx extensions. - Added @vitest/coverage-v8 dependency for improved test coverage reporting. * test: Add unit tests for MultiLevelTable component - Introduced comprehensive unit tests for the MultiLevelTable component, covering rendering, row expansion, sorting, pagination, custom theming, and filtering functionalities. - Validated the correct application of custom styles and rendering for status cells and pagination controls. - Ensured that the component behaves as expected with mock data and various configurations. --------- Co-authored-by: anitta-keyvalue <[email protected]>
1 parent f20903c commit c296bd2

15 files changed

+2793
-27
lines changed

.eslintrc.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2020": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:react-hooks/recommended",
11+
"plugin:react/recommended",
12+
"plugin:react/jsx-runtime",
13+
"prettier"
14+
],
15+
"ignorePatterns": ["dist", ".eslintrc.json"],
16+
"parser": "@typescript-eslint/parser",
17+
"parserOptions": {
18+
"project": ["./tsconfig.json", "./tsconfig.test.json"],
19+
"ecmaVersion": "latest",
20+
"sourceType": "module"
21+
},
22+
"plugins": ["react-refresh", "react", "@typescript-eslint"],
23+
"rules": {
24+
"react-refresh/only-export-components": [
25+
"warn",
26+
{ "allowConstantExport": true }
27+
],
28+
"react/react-in-jsx-scope": "off"
29+
},
30+
"settings": {
31+
"react": {
32+
"version": "detect"
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)