Skip to content

Commit 823f91c

Browse files
committed
Refreshed '.vortex/docs' dependencies and upgraded Jest to 30, Testing Library, 'cspell', 'globals', 'markdownlint-cli2', 'sharp-cli' and the local search plugin.
Forward-ported from main a6bdaf7, f576e44, a4a1a5c, 4817058 and the '.vortex/docs' part of 209e0e7. Took the same majors as main, ported the 'VerticalTabs' test to set the URL through the History API because jsdom 26 does not allow 'window.location' to be redefined, and disabled 'MD060'.
1 parent 5f7758c commit 823f91c

4 files changed

Lines changed: 2794 additions & 2747 deletions

File tree

‎.vortex/docs/.markdownlint.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ MD041: false
3232
MD046:
3333
# Block style
3434
style: "fenced"
35+
36+
# MD060/table-column-style : Table column style : https://github.com/DavidAnson/markdownlint/blob/v0.42.0/doc/md060.md
37+
MD060: false

‎.vortex/docs/package.json‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,36 @@
3333
"@docusaurus/preset-classic": "^3.5",
3434
"@docusaurus/theme-mermaid": "^3.5",
3535
"@docusaurus/types": "^3.5",
36-
"@easyops-cn/docusaurus-search-local": "^0.49.1",
36+
"@easyops-cn/docusaurus-search-local": "^0.55.3",
3737
"@mdx-js/react": "^3.0.0",
3838
"clsx": "^2.0.0",
3939
"prism-react-renderer": "^2.3.0",
4040
"raw-loader": "^4.0.2",
41-
"react": "^18.0.0",
42-
"react-dom": "^18.0.0",
43-
"sharp-cli": "^5.2.0",
41+
"react": "^18.3.1",
42+
"react-dom": "^18.3.1",
43+
"sharp-cli": "^6.1.0",
4444
"svg-term-cli": "^2.1.1"
4545
},
4646
"devDependencies": {
4747
"@babel/core": "^7.0.0",
4848
"@babel/preset-env": "^7.27.2",
4949
"@babel/preset-react": "^7.27.1",
50-
"@testing-library/jest-dom": "^5.16.0",
51-
"@testing-library/react": "^14.0.0",
50+
"@eslint/js": "^9.39.4",
51+
"@testing-library/dom": "^10.4.2",
52+
"@testing-library/jest-dom": "^7.0.1",
53+
"@testing-library/react": "^16.3.3",
5254
"@testing-library/user-event": "^14.0.0",
5355
"@vvago/vale": "^3.22.0",
54-
"babel-jest": "^29.7.0",
55-
"cspell": "^8.6.1",
56-
"@eslint/js": "^9.39.4",
56+
"babel-jest": "^30.5.2",
57+
"cspell": "^9.8.0",
5758
"eslint": "^9.39.4",
5859
"eslint-plugin-react": "^7.37.5",
5960
"eslint-plugin-react-hooks": "^7.1.1",
60-
"globals": "^16.5.0",
61+
"globals": "^17.13.0",
6162
"identity-obj-proxy": "^3.0.0",
62-
"jest": "^29.0.0",
63-
"jest-environment-jsdom": "^29.0.0",
64-
"markdownlint-cli2": "^0.18.1",
63+
"jest": "^30.5.2",
64+
"jest-environment-jsdom": "^30.5.2",
65+
"markdownlint-cli2": "^0.24.0",
6566
"prettier": "^3.0.0"
6667
},
6768
"browserslist": {
@@ -77,6 +78,6 @@
7778
]
7879
},
7980
"engines": {
80-
"node": ">=18.0"
81+
"node": ">=20.19"
8182
}
8283
}

‎.vortex/docs/tests/unit/VerticalTabs/VerticalTabs.test.js‎

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,15 @@ import {
1212
VerticalTabPanel,
1313
} from '../../../src/components/VerticalTabs';
1414

15-
// Mock window.location and history for hash testing
16-
const mockLocation = {
17-
pathname: '/test',
18-
search: '',
19-
hash: '',
20-
};
15+
// jsdom does not allow window.location to be redefined, so the URL is set
16+
// through the real History API before window.history is mocked.
17+
const realHistory = window.history;
18+
const setUrl = url => realHistory.replaceState(null, '', url);
2119

2220
const mockHistory = {
2321
replaceState: jest.fn(),
2422
};
2523

26-
Object.defineProperty(window, 'location', {
27-
value: mockLocation,
28-
writable: true,
29-
});
30-
3124
Object.defineProperty(window, 'history', {
3225
value: mockHistory,
3326
writable: true,
@@ -36,7 +29,7 @@ Object.defineProperty(window, 'history', {
3629
describe('VerticalTabs with VerticalTab/VerticalTabPanel Components', () => {
3730
beforeEach(() => {
3831
// Reset mocks before each test
39-
mockLocation.hash = '';
32+
setUrl('/test');
4033
mockHistory.replaceState.mockClear();
4134

4235
// Clear any existing hashchange listeners
@@ -424,7 +417,7 @@ describe('VerticalTabs with VerticalTab/VerticalTabPanel Components', () => {
424417
describe('Hash-based Active Tab Support', () => {
425418
test('sets active tab from URL hash on mount', () => {
426419
// Set hash to match second tab's slug
427-
mockLocation.hash = '#docker-services';
420+
setUrl('/test#docker-services');
428421

429422
render(
430423
<VerticalTabs>
@@ -510,7 +503,7 @@ describe('VerticalTabs with VerticalTab/VerticalTabPanel Components', () => {
510503
expect(screen.getByText('Drupal content here')).toBeInTheDocument();
511504

512505
// Simulate hash change
513-
mockLocation.hash = '#docker-services';
506+
setUrl('/test#docker-services');
514507
if (hashChangeHandler) {
515508
act(() => {
516509
hashChangeHandler();
@@ -523,7 +516,7 @@ describe('VerticalTabs with VerticalTab/VerticalTabPanel Components', () => {
523516
});
524517

525518
test('ignores invalid hash values', () => {
526-
mockLocation.hash = '#nonexistent-tab';
519+
setUrl('/test#nonexistent-tab');
527520

528521
render(
529522
<VerticalTabs>
@@ -549,7 +542,7 @@ describe('VerticalTabs with VerticalTab/VerticalTabPanel Components', () => {
549542
});
550543

551544
test('handles empty hash correctly', () => {
552-
mockLocation.hash = '';
545+
setUrl('/test');
553546

554547
render(
555548
<VerticalTabs>
@@ -603,7 +596,7 @@ describe('VerticalTabs with VerticalTab/VerticalTabPanel Components', () => {
603596
});
604597

605598
test('preserves search parameters when updating hash', async () => {
606-
mockLocation.search = '?param=value';
599+
setUrl('/test?param=value');
607600

608601
render(
609602
<VerticalTabs>

0 commit comments

Comments
 (0)