Skip to content

Commit 16b4882

Browse files
committed
deps: update vulnerable packages
- Fixes dependabot alert findings: 228, 226, 224, 219, 216, 212, 210, 207, 206, 205, 204, 203, 202 and 201 Refs: KEH-281
1 parent fb06159 commit 16b4882

12 files changed

Lines changed: 1975 additions & 2755 deletions

File tree

package.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@sentry/react": "^9.22.0",
5050
"@typescript-eslint/eslint-plugin": "^8.57.1",
5151
"@typescript-eslint/parser": "^8.57.1",
52-
"@vitejs/plugin-react-swc": "^3.7.1",
52+
"@vitejs/plugin-react-swc": "^4.3.0",
5353
"alertifyjs": "^1.13.1",
5454
"autoprefixer": "^10.4.15",
5555
"bootstrap-sass": "3.4.3",
@@ -118,10 +118,9 @@
118118
"updeep": "^1.2.0",
119119
"url-parse": "^1.5.9",
120120
"uuid": "^9.0.0",
121-
"vite": "^6.4.1",
122-
"vite-plugin-eslint": "^1.8.1",
121+
"vite": "^8.0.3",
123122
"vite-plugin-istanbul": "^7.0.0",
124-
"vitest": "^3.2.4"
123+
"vitest": "^4.1.2"
125124
},
126125
"devDependencies": {
127126
"@commitlint/cli": "^19.8.0",
@@ -130,7 +129,7 @@
130129
"@testing-library/jest-dom": "^6.3.0",
131130
"@testing-library/react": "^15.0.7",
132131
"@testing-library/user-event": "^14.5.2",
133-
"@vitest/coverage-istanbul": "^3.2.4",
132+
"@vitest/coverage-istanbul": "^4.1.2",
134133
"husky": "^8.0.3",
135134
"istanbul-merge": "^2.0.0",
136135
"jsdom": "^26.1.0",
@@ -140,9 +139,16 @@
140139
"vitest-fetch-mock": "^0.4.5"
141140
},
142141
"resolutions": {
143-
"cross-spawn": "^7.0.6",
144-
"micromatch": "^4.0.8",
145-
"rollup": "^4.24.4"
142+
"@draft-js-plugins/drag-n-drop/immutable": "3.8.3",
143+
"@draft-js-plugins/editor/immutable": "3.8.3",
144+
"@draft-js-plugins/focus/immutable": "3.8.3",
145+
"@draft-js-plugins/image/immutable": "3.8.3",
146+
"@draft-js-plugins/resizeable/immutable": "3.8.3",
147+
"draft-convert/immutable": "3.8.3",
148+
"draft-js-export-html/immutable": "3.8.3",
149+
"draft-js-utils/immutable": "3.8.3",
150+
"draft-js/immutable": "3.8.3",
151+
"**/@typescript-eslint/typescript-estree/minimatch": "9.0.7"
146152
},
147153
"snyk": true
148154
}

src/components/Matomo/hooks/__tests__/useMatomo.test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ describe('useMatomo', () => {
3636
it('should trackPageView', () => {
3737
const trackPageViewMock = vi.fn();
3838

39-
vi.spyOn(MatomoTracker, 'default').mockImplementation(() => ({
40-
trackPageView: trackPageViewMock,
41-
}));
39+
vi.spyOn(MatomoTracker, 'default').mockImplementation(function () {
40+
return { trackPageView: trackPageViewMock };
41+
});
4242

4343
const instance = new MatomoTracker.default({
4444
urlBase: MOCK_URL,

src/components/admin/__tests__/HearingEditor.test.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ const renderComponent = (propOverrides) => {
7878
describe('<HearingEditor />', () => {
7979
const originalInterSectionObserver = window.IntersectionObserver;
8080

81-
const intersectionObserverMock = () => ({
82-
observe: () => null,
83-
disconnect: () => null,
84-
});
81+
const intersectionObserverMock = function () {
82+
return {
83+
observe: () => null,
84+
disconnect: () => null,
85+
};
86+
};
8587

8688
beforeAll(() => {
8789
window.IntersectionObserver = vi

src/components/admin/__tests__/HearingForm.test.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,12 @@ const renderComponent = (propOverrides, storeOverride) => {
109109
describe('<HearingForm />', () => {
110110
const originalInterSectionObserver = window.IntersectionObserver;
111111

112-
const intersectionObserverMock = () => ({
113-
observe: () => null,
114-
disconnect: () => null,
115-
});
112+
const intersectionObserverMock = function () {
113+
return {
114+
observe: () => null,
115+
disconnect: () => null,
116+
};
117+
};
116118

117119
beforeAll(() => {
118120
window.IntersectionObserver = vi

src/components/admin/__tests__/HearingFormStep2.test.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ const renderComponent = (propOverrides, storeOverride) => {
5555
describe('<HearingFormStep2 />', () => {
5656
const originalInterSectionObserver = window.IntersectionObserver;
5757

58-
const intersectionObserverMock = () => ({
59-
observe: () => null,
60-
disconnect: () => null,
61-
});
58+
const intersectionObserverMock = function () {
59+
return {
60+
observe: () => null,
61+
disconnect: () => null,
62+
};
63+
};
6264

6365
beforeAll(() => {
6466
window.IntersectionObserver = vi

src/components/admin/__tests__/SectionForm.test.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ const renderComponent = (propOverrides, storeOverride) => {
4242
describe('<SectionForm />', () => {
4343
const originalInterSectionObserver = window.IntersectionObserver;
4444

45-
const intersectionObserverMock = () => ({
46-
observe: () => null,
47-
disconnect: () => null,
48-
});
45+
const intersectionObserverMock = function () {
46+
return {
47+
observe: () => null,
48+
disconnect: () => null,
49+
};
50+
};
4951

5052
beforeAll(() => {
5153
window.IntersectionObserver = vi

src/setupTests.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,21 @@ import { getCityConfig, getCityPublic } from '../scripts/utils';
1010

1111
const USE_TEST_ENV = process.env.NODE_ENV === 'test';
1212
const defaultNodeEnv = USE_TEST_ENV ? 'test' : 'development';
13-
14-
/* @ts-ignore */
15-
import.meta.env = {};
16-
17-
import.meta.env.NODE_ENV = process.env.NODE_ENV || defaultNodeEnv;
13+
const runtimeEnv = {
14+
...process.env,
15+
NODE_ENV: process.env.NODE_ENV || defaultNodeEnv,
16+
};
1817

1918
dotenv.config({
20-
processEnv: import.meta.env,
19+
processEnv: runtimeEnv,
2120
...(USE_TEST_ENV
2221
? { path: ['.env', '.env.test'] }
2322
: { path: ['.env', '.env.local'] }),
2423
override: true,
2524
});
2625

27-
const cityConfig = getCityConfig(import.meta.env);
28-
const cityPublic = getCityPublic(import.meta.env, cityConfig);
26+
const cityConfig = getCityConfig(runtimeEnv);
27+
const cityPublic = getCityPublic(runtimeEnv, cityConfig);
2928

3029
// Load generated runtime configuration to be available in tests
3130
require(`${cityPublic}/test-env-config`);
@@ -57,6 +56,17 @@ class ResizeObserver {
5756
// Add ResizeObserver to the global object
5857
global.ResizeObserver = ResizeObserver;
5958

59+
// Mock IntersectionObserver which is not available in JSDOM
60+
class IntersectionObserver {
61+
constructor() {
62+
this.observe = vi.fn();
63+
this.unobserve = vi.fn();
64+
this.disconnect = vi.fn();
65+
}
66+
}
67+
68+
global.IntersectionObserver = IntersectionObserver;
69+
6070
Object.assign(global, { TextDecoder, TextEncoder });
6171

6272
const originalError = console.error.bind(console.error);

src/utils/__tests__/hearingEditor.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { describe } from 'node:test';
2-
31
import { prepareSection, validateHearing } from '../hearingEditor';
42
import { initNewHearing } from '../hearing';
53

src/utils/__tests__/map.test.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ vi.mock('leaflet', async () => {
88

99
return {
1010
...mod,
11-
LatLng: vi.fn((lat, lng) => ({ lat, lng })),
12-
Icon: vi.fn(() => ({})),
11+
LatLng: vi.fn(function (lat, lng) {
12+
return { lat, lng };
13+
}),
14+
Icon: vi.fn(function () {
15+
return {};
16+
}),
1317
};
1418
});
1519

src/utils/leafletDrawCompat.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import * as leafletDraw from 'leaflet-draw/dist/leaflet.draw.js';
2+
3+
export default leafletDraw;

0 commit comments

Comments
 (0)