Skip to content

Commit 50f7d55

Browse files
committed
tests: update configuration and tests
1 parent 8efff79 commit 50f7d55

File tree

9 files changed

+1575
-1644
lines changed

9 files changed

+1575
-1644
lines changed

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
],
66
"scripts": {
77
"charts:build": "lerna run --scope \"@coreui/react-chartjs\" build --stream",
8+
"charts:test": "lerna run --scope \"@coreui/react-chartjs\" test --stream",
9+
"charts:test:update": "lerna run --scope \"@coreui/react-chartjs\" test:update --stream",
810
"docs:api": "lerna run --scope \"@coreui/react-docs\" api --stream",
911
"docs:dev": "lerna run --scope \"@coreui/react-docs\" develop --stream",
1012
"docs:build": "lerna run --scope \"@coreui/react-docs\" build --stream",
1113
"docs:clean": "lerna run --scope \"@coreui/react-docs\" clean",
1214
"icons:build": "lerna run --scope \"@coreui/icons-react\" build --stream",
15+
"icons:test": "lerna run --scope \"@coreui/icons-react\" test --stream",
16+
"icons:test:update": "lerna run --scope \"@coreui/icons-react\" test:update --stream",
1317
"lib:build": "lerna run --scope \"@coreui/react\" build --stream",
18+
"lib:test": "lerna run --scope \"@coreui/react\" test --stream",
19+
"lib:test:update": "lerna run --scope \"@coreui/react\" test:update --stream",
1420
"lint": "eslint \"packages/**/src/**/*.{js,ts,tsx}\"",
15-
"test": "jest --coverage",
16-
"test:update": "jest --coverage --updateSnapshot"
21+
"test": "npm-run-all charts:test icons:test lib:test",
22+
"test:update": "npm-run-all charts:test:update icons:test:update lib:test:update"
1723
},
1824
"devDependencies": {
1925
"@typescript-eslint/eslint-plugin": "^5.50.0",
@@ -23,11 +29,8 @@
2329
"eslint-plugin-prettier": "^4.2.1",
2430
"eslint-plugin-react": "^7.32.2",
2531
"eslint-plugin-react-hooks": "^4.6.0",
26-
"jest": "^29.4.1",
27-
"jest-canvas-mock": "^2.4.0",
28-
"jest-environment-jsdom": "^29.4.1",
2932
"lerna": "^4.0.0",
30-
"prettier": "^2.8.3",
31-
"ts-jest": "^29.0.5"
33+
"npm-run-all": "^4.1.5",
34+
"prettier": "^2.8.3"
3235
}
3336
}

jest.config.js renamed to packages/coreui-react/jest.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
'use strict'
99

1010
module.exports = {
11-
moduleNameMapper: {
12-
'\\.(css|scss)$': '<rootDir>/packages/coreui-icons-react/test/styleMock.js',
13-
},
1411
preset: 'ts-jest',
15-
setupFiles: ['jest-canvas-mock'],
1612
testEnvironment: 'jsdom',
1713
testPathIgnorePatterns: ['dist/'],
1814
}

packages/coreui-react/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
"src/"
3333
],
3434
"scripts": {
35-
"build": "rollup -c --bundleConfigAsCjs"
35+
"build": "rollup -c --bundleConfigAsCjs",
36+
"test": "jest --coverage",
37+
"test:update": "jest --coverage --updateSnapshot"
3638
},
3739
"devDependencies": {
3840
"@popperjs/core": "^2.11.6",
@@ -45,13 +47,16 @@
4547
"@types/react-dom": "^18.0.10",
4648
"@types/react-transition-group": "^4.4.5",
4749
"classnames": "^2.3.2",
50+
"jest": "^29.4.1",
51+
"jest-environment-jsdom": "^29.4.1",
4852
"prop-types": "^15.8.1",
4953
"react": "^18.2.0",
5054
"react-dom": "^18.2.0",
5155
"react-popper": "^2.3.0",
5256
"react-transition-group": "^4.4.5",
5357
"rollup": "^3.14.0",
5458
"tslib": "^2.5.0",
59+
"ts-jest": "^29.0.5",
5560
"typescript": "^4.9.5"
5661
},
5762
"peerDependencies": {

packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionBody.spec.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`CAccordionBody customize 1`] = `
44
<div>
55
<div
6-
class="accordion-collpase collapse"
6+
class="accordion-collapse collapse"
77
>
88
<div
99
class="accordion-body"
@@ -17,7 +17,7 @@ exports[`CAccordionBody customize 1`] = `
1717
exports[`loads and displays CAccordionBody component 1`] = `
1818
<div>
1919
<div
20-
class="accordion-collpase collapse"
20+
class="accordion-collapse collapse"
2121
>
2222
<div
2323
class="accordion-body"

packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormRange.spec.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports[`CFormRange customize 1`] = `
88
max="150"
99
min="20"
1010
readonly=""
11-
steps="2"
11+
step="2"
1212
type="range"
1313
value="80"
1414
/>
@@ -19,7 +19,7 @@ exports[`loads and displays CFormRange component 1`] = `
1919
<div>
2020
<input
2121
class="form-range"
22-
steps="3"
22+
step="3"
2323
type="range"
2424
/>
2525
</div>

packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvas.spec.tsx.snap

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
exports[`COffcanvas customize and event on click backdrop 1`] = `
44
<div>
55
<div
6-
class="offcanvas offcanvas-end show bazinga"
6+
class="offcanvas offcanvas-end bazinga show"
77
role="dialog"
8-
style="visibility: visible;"
98
tabindex="-1"
109
>
1110
Test
@@ -19,9 +18,8 @@ exports[`COffcanvas customize and event on click backdrop 1`] = `
1918
exports[`COffcanvas customize and event on keypress 1`] = `
2019
<div>
2120
<div
22-
class="offcanvas offcanvas-end show bazinga"
21+
class="offcanvas offcanvas-end bazinga show"
2322
role="dialog"
24-
style="visibility: visible;"
2523
tabindex="-1"
2624
>
2725
Test
@@ -37,12 +35,19 @@ exports[`COffcanvas customize one 1`] = `
3735
<div
3836
class="offcanvas offcanvas-start bazinga"
3937
role="dialog"
40-
style="visibility: hidden;"
4138
tabindex="-1"
4239
>
4340
Test
4441
</div>
4542
</div>
4643
`;
4744

48-
exports[`loads and displays COffcanvas component 1`] = `<div />`;
45+
exports[`loads and displays COffcanvas component 1`] = `
46+
<div>
47+
<div
48+
class="offcanvas offcanvas-top"
49+
role="dialog"
50+
tabindex="-1"
51+
/>
52+
</div>
53+
`;

packages/coreui-react/src/components/table/__tests__/__snapshots__/CTable.spec.tsx.snap

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ exports[`CTable customize 1`] = `
88
<table
99
class="table align-middle border-primary caption-top table-bordered table-borderless table-info table-hover table-sm table-striped bazinga"
1010
>
11-
<tbody />
1211
<tbody>
1312
<tr>
1413
<td>
@@ -26,7 +25,6 @@ exports[`CTable full example test 1`] = `
2625
<table
2726
class="table caption-top"
2827
>
29-
<tbody />
3028
<caption>
3129
List of users
3230
</caption>
@@ -194,8 +192,6 @@ exports[`loads and displays CTable component 1`] = `
194192
<div>
195193
<table
196194
class="table"
197-
>
198-
<tbody />
199-
</table>
195+
/>
200196
</div>
201197
`;

packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToast.spec.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ exports[`CToast customize 5`] = `
5757
<div
5858
aria-atomic="true"
5959
aria-live="assertive"
60-
class="toast fade bg-warning border-0 bazinga showing"
60+
class="toast fade bg-warning border-0 bazinga show"
6161
role="alert"
6262
>
6363
Test

0 commit comments

Comments
 (0)