@eeacms/volto-eea-website-theme 4.3.6 → 4.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- ### [4.3.6](https://github.com/eea/volto-eea-website-theme/compare/4.3.5...4.3.6) - 3 June 2026
7
+ ### [4.3.7](https://github.com/eea/volto-eea-website-theme/compare/4.3.6...4.3.7) - 6 June 2026
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: accordion in view for gone pages - refs #304005 [Teodor Voicu - [`8b4adf9`](https://github.com/eea/volto-eea-website-theme/commit/8b4adf991b65a9e106603b04f386737611da0e0b)]
12
+ - fix: Print styles - refs #271000 [Teodor Voicu - [`1759cb2`](https://github.com/eea/volto-eea-website-theme/commit/1759cb2bfd91af6c173edf9d94f29d5a78f5cdf9)]
13
+
14
+ ### [4.3.6](https://github.com/eea/volto-eea-website-theme/compare/4.3.5...4.3.6) - 4 June 2026
8
15
 
9
16
  #### :bug: Bug Fixes
10
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "4.3.6",
3
+ "version": "4.3.7",
4
4
  "description": "@eeacms/volto-eea-website-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -76,6 +76,7 @@ const GoneView = () => {
76
76
  aria-expanded={activeIndex === 0}
77
77
  onKeyDown={(e) => {
78
78
  if (e.keyCode === 13 || e.keyCode === 32) {
79
+ e.preventDefault();
79
80
  handleAccordionClick(e, { index: 0 });
80
81
  }
81
82
  }}
@@ -128,6 +129,7 @@ const GoneView = () => {
128
129
  aria-expanded={activeIndex === 2}
129
130
  onKeyDown={(e) => {
130
131
  if (e.keyCode === 13 || e.keyCode === 32) {
132
+ e.preventDefault();
131
133
  handleAccordionClick(e, { index: 2 });
132
134
  }
133
135
  }}
@@ -45,6 +45,15 @@ describe('GoneView Component', () => {
45
45
  let history;
46
46
  let store;
47
47
 
48
+ const renderGoneView = () =>
49
+ render(
50
+ <Provider store={store}>
51
+ <Router history={history}>
52
+ <GoneView />
53
+ </Router>
54
+ </Provider>,
55
+ );
56
+
48
57
  beforeEach(() => {
49
58
  history = createMemoryHistory();
50
59
  store = mockStore({
@@ -135,13 +144,7 @@ describe('GoneView Component', () => {
135
144
  });
136
145
 
137
146
  it('opens first accordion when clicked', () => {
138
- render(
139
- <Provider store={store}>
140
- <Router history={history}>
141
- <GoneView />
142
- </Router>
143
- </Provider>,
144
- );
147
+ renderGoneView();
145
148
 
146
149
  const firstAccordion = screen.getByText('View archived version');
147
150
  fireEvent.click(firstAccordion);
@@ -150,13 +153,7 @@ describe('GoneView Component', () => {
150
153
  });
151
154
 
152
155
  it('opens second accordion when clicked', () => {
153
- render(
154
- <Provider store={store}>
155
- <Router history={history}>
156
- <GoneView />
157
- </Router>
158
- </Provider>,
159
- );
156
+ renderGoneView();
160
157
 
161
158
  const secondAccordion = screen.getByText('Looking for something specific?');
162
159
  fireEvent.click(secondAccordion);
@@ -214,4 +211,53 @@ describe('GoneView Component', () => {
214
211
  expect(searchLink.getAttribute('href')).toBe('/en/advanced-search');
215
212
  expect(homepageLink.getAttribute('href')).toBe('/en');
216
213
  });
214
+
215
+ it('updates aria-expanded when the accordion titles are clicked', () => {
216
+ renderGoneView();
217
+
218
+ const archiveTitle = screen.getByRole('button', {
219
+ name: 'View archived version',
220
+ });
221
+ const searchTitle = screen.getByRole('button', {
222
+ name: 'Looking for something specific?',
223
+ });
224
+
225
+ expect(archiveTitle.getAttribute('aria-expanded')).toBe('false');
226
+ expect(searchTitle.getAttribute('aria-expanded')).toBe('false');
227
+
228
+ fireEvent.click(archiveTitle);
229
+
230
+ expect(archiveTitle.getAttribute('aria-expanded')).toBe('true');
231
+ expect(searchTitle.getAttribute('aria-expanded')).toBe('false');
232
+
233
+ fireEvent.click(searchTitle);
234
+
235
+ expect(archiveTitle.getAttribute('aria-expanded')).toBe('false');
236
+ expect(searchTitle.getAttribute('aria-expanded')).toBe('true');
237
+ });
238
+
239
+ it('toggles accordion titles with Enter and Space', () => {
240
+ renderGoneView();
241
+
242
+ const archiveTitle = screen.getByRole('button', {
243
+ name: 'View archived version',
244
+ });
245
+ const searchTitle = screen.getByRole('button', {
246
+ name: 'Looking for something specific?',
247
+ });
248
+
249
+ fireEvent.keyDown(archiveTitle, { keyCode: 13 });
250
+
251
+ expect(archiveTitle.getAttribute('aria-expanded')).toBe('true');
252
+ expect(screen.getByText('Wayback Machine')).toBeTruthy();
253
+
254
+ fireEvent.keyDown(archiveTitle, { keyCode: 32 });
255
+
256
+ expect(archiveTitle.getAttribute('aria-expanded')).toBe('false');
257
+
258
+ fireEvent.keyDown(searchTitle, { keyCode: 32 });
259
+
260
+ expect(searchTitle.getAttribute('aria-expanded')).toBe('true');
261
+ expect(screen.getByText('search')).toBeTruthy();
262
+ });
217
263
  });
@@ -255,6 +255,9 @@ export const setupPrintView = (dispatch) => {
255
255
  window.print();
256
256
  } catch (error) {
257
257
  // Still try to print even if there was an error
258
+ Array.from(tabs).forEach((tab) => {
259
+ tab.style.display = '';
260
+ });
258
261
  dispatch(setPrintLoading(false));
259
262
  dispatch(setIsPrint(false));
260
263
  window.print();