@eeacms/volto-eea-design-system 1.16.0 → 1.18.0
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 +57 -0
- package/docker-compose.yml +5 -1
- package/locales/en/LC_MESSAGES/volto.po +14 -0
- package/package.json +1 -1
- package/src/helpers/index.js +4 -4
- package/src/helpers/useClickOutside.test.js +63 -0
- package/src/helpers/useFirstVisited.test.js +54 -0
- package/src/ui/Accordion/Accordion.stories.js +3 -1
- package/src/ui/Accordion/Accordion.stories.test.js +45 -0
- package/src/ui/Banner/Banner.test.jsx +292 -0
- package/src/ui/CallToAction/CallToAction.stories.test.jsx +69 -0
- package/src/ui/Card/Card.stories.test.jsx +78 -0
- package/src/ui/Card/IconCard/IconCard.stories.test.jsx +64 -0
- package/src/ui/Card/RelatedContent/RelatedContent.jsx +1 -1
- package/src/ui/Card/RelatedContent/RelatedContent.stories.jsx +2 -2
- package/src/ui/Card/RelatedContent/RelatedContent.stories.test.jsx +65 -0
- package/src/ui/Confirm/Confirm.stories.test.js +27 -0
- package/src/ui/ContextNavigation/ContextNavigation.stories.test.jsx +170 -0
- package/src/ui/Divider/Divider.stories.test.jsx +44 -0
- package/src/ui/DownloadLabeledIcon/DownloadLabeledIcon.stories.test.jsx +24 -0
- package/src/ui/Footer/Description.test.jsx +11 -0
- package/src/ui/Footer/Footer.stories.test.js +131 -0
- package/src/ui/Footer/Social.test.jsx +11 -0
- package/src/ui/Form/Button/Button.stories.test.jsx +55 -0
- package/src/ui/Form/Checkbox.stories.test.js +79 -0
- package/src/ui/Form/Dropdown.stories.test.js +24 -0
- package/src/ui/Form/Radio.stories.test.js +55 -0
- package/src/ui/Form/Textarea.stories.test.js +41 -0
- package/src/ui/Form/input.stories.test.js +52 -0
- package/src/ui/Grid/ComponentGrid.stories.test.js +21 -0
- package/src/ui/Header/Header.stories.test.js +158 -0
- package/src/ui/Header/Header.test.jsx +293 -0
- package/src/ui/Header/HeaderMenuPopUp.js +12 -4
- package/src/ui/Header/HeaderSearchPopUp.test.js +114 -0
- package/src/ui/Hero/Hero.stories.test.jsx +67 -0
- package/src/ui/InpageNavigation/InpageNavigation.stories.test.jsx +10 -0
- package/src/ui/InpageNavigation/InpageNavigation.test.jsx +87 -0
- package/src/ui/Item/Item.stories.test.js +39 -0
- package/src/ui/Item/ItemGroupWithIcons.stories.test.js +119 -0
- package/src/ui/Label/Label.stories.test.js +76 -0
- package/src/ui/LabeledIconGroup/LabeledIconGroup.stories.test.jsx +19 -0
- package/src/ui/LanguageLabeledIcon/LanguageLabeledIcon.jsx +3 -2
- package/src/ui/LanguageLabeledIcon/LanguangeLabeledIcon.test.jsx +60 -0
- package/src/ui/Loader/Loader.stories.test.jsx +30 -0
- package/src/ui/Logo/Logo.stories.test.jsx +81 -0
- package/src/ui/Media/Image.stories.test.js +35 -0
- package/src/ui/Message/Message.stories.test.js +44 -0
- package/src/ui/Modal/Modal.stories.test.js +45 -0
- package/src/ui/Popup/Popup.jsx +24 -17
- package/src/ui/Popup/Popup.test.jsx +60 -0
- package/src/ui/Progress/Progress.stories.test.js +30 -0
- package/src/ui/Quote/Testimonial/Testimonial.stories.test.jsx +18 -0
- package/src/ui/Statistic/Statistic.stories.test.js +93 -0
- package/src/ui/Table/Table.stories.js +8 -0
- package/src/ui/Table/Table.stories.test.js +54 -0
- package/src/ui/Timeline/Timeline.stories.test.jsx +43 -0
- package/src/ui/index.js +21 -41
- package/theme/themes/eea/assets/images/Footer/Extras/footer-visual.svg +1 -2065
- package/theme/themes/eea/extras/banner.less +3 -3
- package/theme/themes/eea/modules/accordion.overrides +36 -11
- package/theme/themes/eea/modules/accordion.variables +2 -0
- package/theme/themes/eea/views/item.overrides +21 -0
- package/src/i18n.js +0 -180
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import {
|
|
4
|
+
Text,
|
|
5
|
+
Labeled,
|
|
6
|
+
Inverted,
|
|
7
|
+
Secondary,
|
|
8
|
+
Primary,
|
|
9
|
+
Default,
|
|
10
|
+
} from './Button.stories';
|
|
11
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
12
|
+
|
|
13
|
+
describe('Text component', () => {
|
|
14
|
+
it('renders a button with label', () => {
|
|
15
|
+
const { getByText } = render(<Text {...Text.args} />);
|
|
16
|
+
expect(getByText(Text.args.label)).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('Labeled component', () => {
|
|
21
|
+
it('renders a button with label', () => {
|
|
22
|
+
const { getByText } = render(<Labeled {...Labeled.args} />);
|
|
23
|
+
expect(getByText(Labeled.args.label)).toBeInTheDocument();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe('Inverted component', () => {
|
|
28
|
+
it('renders a button with label', () => {
|
|
29
|
+
const { getByText } = render(<Inverted {...Inverted.args} />);
|
|
30
|
+
expect(getByText(Inverted.args.button1)).toBeInTheDocument();
|
|
31
|
+
expect(getByText(Inverted.args.button2)).toBeInTheDocument();
|
|
32
|
+
expect(getByText(Inverted.args.button3)).toBeInTheDocument();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('Secondary component', () => {
|
|
37
|
+
it('renders a button with label', () => {
|
|
38
|
+
const { getByText } = render(<Secondary {...Secondary.args} />);
|
|
39
|
+
expect(getByText(Secondary.args.label)).toBeInTheDocument();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('Primary component', () => {
|
|
44
|
+
it('renders a button with label', () => {
|
|
45
|
+
const { getByText } = render(<Primary {...Primary.args} />);
|
|
46
|
+
expect(getByText(Primary.args.label)).toBeInTheDocument();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('Default component', () => {
|
|
51
|
+
it('renders a button with label', () => {
|
|
52
|
+
const { getByText } = render(<Default {...Default.args} />);
|
|
53
|
+
expect(getByText(Default.args.label)).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
+
import {
|
|
4
|
+
single as Single,
|
|
5
|
+
optional as Optional,
|
|
6
|
+
invalid as Invalid,
|
|
7
|
+
} from './Checkbox.stories';
|
|
8
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
9
|
+
|
|
10
|
+
describe('Single', () => {
|
|
11
|
+
it('renders correctly', () => {
|
|
12
|
+
const { container, getByText, queryByText } = render(
|
|
13
|
+
<Single {...Single.args} />,
|
|
14
|
+
);
|
|
15
|
+
expect(getByText(Single.args.label)).toBeInTheDocument();
|
|
16
|
+
expect(queryByText(Single.args.requiredText)).toEqual(null);
|
|
17
|
+
|
|
18
|
+
fireEvent.click(container.querySelector('#field4'));
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('renders correctly', () => {
|
|
22
|
+
const { container, getByText } = render(
|
|
23
|
+
<Single {...Single.args} required={true} invalid={true} />,
|
|
24
|
+
);
|
|
25
|
+
expect(getByText(Single.args.label)).toBeInTheDocument();
|
|
26
|
+
expect(getByText(Single.args.requiredText)).toBeInTheDocument();
|
|
27
|
+
|
|
28
|
+
fireEvent.click(container.querySelector('#field4'));
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('Optional', () => {
|
|
33
|
+
it('renders correctly', () => {
|
|
34
|
+
const { container, getByText, queryByText } = render(
|
|
35
|
+
<Optional {...Optional.args} />,
|
|
36
|
+
);
|
|
37
|
+
expect(getByText(Optional.args.label)).toBeInTheDocument();
|
|
38
|
+
expect(queryByText(Optional.args.requiredText)).toEqual(null);
|
|
39
|
+
|
|
40
|
+
fireEvent.click(container.querySelector('#field1'));
|
|
41
|
+
fireEvent.click(container.querySelector('#field2'));
|
|
42
|
+
fireEvent.click(container.querySelector('#field3'));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('renders correctly', () => {
|
|
46
|
+
const { container, getByText } = render(
|
|
47
|
+
<Optional {...Optional.args} required={true} />,
|
|
48
|
+
);
|
|
49
|
+
expect(getByText(Optional.args.label)).toBeInTheDocument();
|
|
50
|
+
expect(getByText(Optional.args.requiredText)).toBeInTheDocument();
|
|
51
|
+
|
|
52
|
+
fireEvent.click(container.querySelector('#field1'));
|
|
53
|
+
fireEvent.click(container.querySelector('#field2'));
|
|
54
|
+
fireEvent.click(container.querySelector('#field3'));
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('Invalid', () => {
|
|
59
|
+
it('renders correctly', () => {
|
|
60
|
+
const { container, getByText } = render(<Invalid {...Invalid.args} />);
|
|
61
|
+
expect(getByText(Invalid.args.label)).toBeInTheDocument();
|
|
62
|
+
|
|
63
|
+
fireEvent.click(container.querySelector('#field1'));
|
|
64
|
+
fireEvent.click(container.querySelector('#field2'));
|
|
65
|
+
fireEvent.click(container.querySelector('#field3'));
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('renders correctly', () => {
|
|
69
|
+
const { container, getByText } = render(
|
|
70
|
+
<Invalid {...Invalid.args} required={true} />,
|
|
71
|
+
);
|
|
72
|
+
expect(getByText(Invalid.args.label)).toBeInTheDocument();
|
|
73
|
+
expect(getByText(Invalid.args.requiredText)).toBeInTheDocument();
|
|
74
|
+
|
|
75
|
+
fireEvent.click(container.querySelector('#field1'));
|
|
76
|
+
fireEvent.click(container.querySelector('#field2'));
|
|
77
|
+
fireEvent.click(container.querySelector('#field3'));
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { ErrorDropdown, Default } from './Dropdown.stories';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
|
|
6
|
+
describe('ErrorDropdown component', () => {
|
|
7
|
+
it('renders correctly', () => {
|
|
8
|
+
const { getByText } = render(<ErrorDropdown {...ErrorDropdown.args} />);
|
|
9
|
+
ErrorDropdown.args.options.forEach((item) => {
|
|
10
|
+
expect(getByText(item.value)).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
|
+
expect(getByText(ErrorDropdown.args.placeholder)).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe('Default component', () => {
|
|
17
|
+
it('renders correctly', () => {
|
|
18
|
+
const { getByText } = render(<Default {...Default.args} />);
|
|
19
|
+
Default.args.options.forEach((item) => {
|
|
20
|
+
expect(getByText(item.value)).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
expect(getByText(Default.args.placeholder)).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
+
import { Default, invalid as Invalid, BinaryRadio } from './Radio.stories';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
|
|
6
|
+
describe('BinaryRadio component', () => {
|
|
7
|
+
it('renders corectly', () => {
|
|
8
|
+
const { container, getByText, queryByText } = render(
|
|
9
|
+
<BinaryRadio {...BinaryRadio.args} />,
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
expect(getByText(BinaryRadio.args.label)).toBeInTheDocument();
|
|
13
|
+
expect(queryByText(BinaryRadio.args.requiredText)).toEqual(null);
|
|
14
|
+
|
|
15
|
+
fireEvent.click(container.querySelector('#radio-yes'));
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders corectly', () => {
|
|
19
|
+
const { getByText } = render(
|
|
20
|
+
<BinaryRadio {...BinaryRadio.args} required={true} invalid={true} />,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(getByText(BinaryRadio.args.label)).toBeInTheDocument();
|
|
24
|
+
expect(getByText(BinaryRadio.args.requiredText)).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe('Invalid component', () => {
|
|
29
|
+
it('renders corectly', () => {
|
|
30
|
+
const { getByText } = render(<Invalid {...Invalid.args} />);
|
|
31
|
+
|
|
32
|
+
expect(getByText(Invalid.args.label)).toBeInTheDocument();
|
|
33
|
+
expect(getByText(Invalid.args.requiredText)).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('Default component', () => {
|
|
38
|
+
it('renders corectly', () => {
|
|
39
|
+
const { getByText } = render(<Default {...Default.args} />);
|
|
40
|
+
|
|
41
|
+
expect(getByText(Default.args.label)).toBeInTheDocument();
|
|
42
|
+
expect(getByText(Default.args.requiredText)).toBeInTheDocument();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('renders corectly', () => {
|
|
46
|
+
const { container, getByText, queryByText } = render(
|
|
47
|
+
<Default {...Default.args} required={false} />,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
expect(getByText(Default.args.label)).toBeInTheDocument();
|
|
51
|
+
expect(queryByText(Default.args.requiredText)).toEqual(null);
|
|
52
|
+
|
|
53
|
+
fireEvent.click(container.querySelector('#field1'));
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { ErrorTextArea, LabeledTextArea, Default } from './Textarea.stories';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
|
|
6
|
+
describe('ErrorTextArea component', () => {
|
|
7
|
+
it('renders correctly', () => {
|
|
8
|
+
const { container, getByText } = render(
|
|
9
|
+
<ErrorTextArea {...ErrorTextArea.args} />,
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
expect(getByText(ErrorTextArea.args.label)).toBeInTheDocument();
|
|
13
|
+
expect(getByText('This is a mandatory field')).toBeInTheDocument();
|
|
14
|
+
expect(
|
|
15
|
+
container.querySelector('textarea[placeholder="Type here..."]'),
|
|
16
|
+
).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('LabeledTextArea component', () => {
|
|
21
|
+
it('renders correctly', () => {
|
|
22
|
+
const { container, getByText } = render(
|
|
23
|
+
<LabeledTextArea {...LabeledTextArea.args} />,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
expect(getByText(LabeledTextArea.args.label)).toBeInTheDocument();
|
|
27
|
+
expect(
|
|
28
|
+
container.querySelector('textarea[placeholder="Type here..."]'),
|
|
29
|
+
).toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('Default component', () => {
|
|
34
|
+
it('renders correctly', () => {
|
|
35
|
+
const { container } = render(<Default {...Default.args} fluid={true} />);
|
|
36
|
+
|
|
37
|
+
expect(
|
|
38
|
+
container.querySelector('textarea[placeholder="Type here..."]'),
|
|
39
|
+
).toBeInTheDocument();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import {
|
|
4
|
+
Default,
|
|
5
|
+
StandardInput,
|
|
6
|
+
DisabledInput,
|
|
7
|
+
LoadingInput,
|
|
8
|
+
ErrorInput,
|
|
9
|
+
} from './Input.stories';
|
|
10
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
11
|
+
|
|
12
|
+
describe('ErrorInput component', () => {
|
|
13
|
+
it('renders corectly', () => {
|
|
14
|
+
const { getByText } = render(<ErrorInput {...ErrorInput.args} />);
|
|
15
|
+
|
|
16
|
+
expect(getByText(ErrorInput.args.label)).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('LoadingInput component', () => {
|
|
21
|
+
it('renders corectly', () => {
|
|
22
|
+
const { getByText } = render(<LoadingInput {...LoadingInput.args} />);
|
|
23
|
+
|
|
24
|
+
expect(getByText(LoadingInput.args.label)).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe('DisabledInput component', () => {
|
|
29
|
+
it('renders corectly', () => {
|
|
30
|
+
const { getByText } = render(<DisabledInput {...DisabledInput.args} />);
|
|
31
|
+
|
|
32
|
+
expect(getByText(DisabledInput.args.label)).toBeInTheDocument();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('StandardInput component', () => {
|
|
37
|
+
it('renders corectly', () => {
|
|
38
|
+
const { getByText } = render(<StandardInput {...StandardInput.args} />);
|
|
39
|
+
|
|
40
|
+
expect(getByText(StandardInput.args.label)).toBeInTheDocument();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('Default component', () => {
|
|
45
|
+
it('renders corectly', () => {
|
|
46
|
+
const { container } = render(<Default {...Default.args} />);
|
|
47
|
+
|
|
48
|
+
expect(
|
|
49
|
+
container.querySelector('input#temp-id[placeholder="Placeholder"]'),
|
|
50
|
+
).toBeInTheDocument();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { GridExamples, Basic12 } from './ComponentGrid.stories';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
|
|
6
|
+
describe('GridExamples component', () => {
|
|
7
|
+
it('renders corectly', () => {
|
|
8
|
+
const { getAllByText } = render(<GridExamples />);
|
|
9
|
+
|
|
10
|
+
expect(getAllByText('12/2')).toHaveLength(3);
|
|
11
|
+
expect(getAllByText('12/3')).toHaveLength(3);
|
|
12
|
+
expect(getAllByText('12/4')).toHaveLength(6);
|
|
13
|
+
expect(getAllByText('12/5')).toHaveLength(5);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('Basic12 component', () => {
|
|
18
|
+
it('renders corectly', () => {
|
|
19
|
+
render(<Basic12 />);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createMemoryHistory } from 'history';
|
|
3
|
+
import { Router } from 'react-router-dom';
|
|
4
|
+
import { render, fireEvent, act } from '@testing-library/react';
|
|
5
|
+
import { Default } from './Header.stories';
|
|
6
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
7
|
+
|
|
8
|
+
global.ResizeObserver = require('resize-observer-polyfill');
|
|
9
|
+
|
|
10
|
+
const history = createMemoryHistory();
|
|
11
|
+
|
|
12
|
+
const links = [
|
|
13
|
+
{ title: 'EEA Main Portal', href: '/#portal' },
|
|
14
|
+
{ title: 'Biodiversity Information System for Europe', href: '/#bise' },
|
|
15
|
+
{ title: 'Forest Information System for Europe', href: '/#Fise' },
|
|
16
|
+
{ title: 'Marine Water Information System for Europe', href: '/#marine' },
|
|
17
|
+
{ title: 'Fresh Water Information System for Europe', href: '/#freshwater' },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const languages = [
|
|
21
|
+
{ name: 'Български', code: 'bg' },
|
|
22
|
+
{ name: 'čeština', code: 'cs' },
|
|
23
|
+
{ name: 'Hrvatski', code: 'hr' },
|
|
24
|
+
{ name: 'dansk', code: 'da' },
|
|
25
|
+
{ name: 'Nederlands', code: 'nl' },
|
|
26
|
+
{ name: 'ελληνικά', code: 'el' },
|
|
27
|
+
{ name: 'English', code: 'en' },
|
|
28
|
+
{ name: 'eesti', code: 'et' },
|
|
29
|
+
{ name: 'Suomi', code: 'fi' },
|
|
30
|
+
{ name: 'Français', code: 'fr' },
|
|
31
|
+
{ name: 'Deutsch', code: 'de' },
|
|
32
|
+
{ name: 'magyar', code: 'hu' },
|
|
33
|
+
{ name: 'Íslenska', code: 'is' },
|
|
34
|
+
{ name: 'italiano', code: 'it' },
|
|
35
|
+
{ name: 'Latviešu', code: 'lv' },
|
|
36
|
+
{ name: 'lietuvių', code: 'lt' },
|
|
37
|
+
{ name: 'Malti', code: 'mt' },
|
|
38
|
+
{ name: 'Norsk', code: 'no' },
|
|
39
|
+
{ name: 'polski', code: 'pl' },
|
|
40
|
+
{ name: 'Português', code: 'pt' },
|
|
41
|
+
{ name: 'Română', code: 'ro' },
|
|
42
|
+
{ name: 'slovenčina', code: 'sk' },
|
|
43
|
+
{ name: 'Slovenščina', code: 'sl' },
|
|
44
|
+
{ name: 'Español', code: 'es' },
|
|
45
|
+
{ name: 'Svenska', code: 'sv' },
|
|
46
|
+
{ name: 'Türkçe', code: 'tr' },
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const menuItems = [
|
|
50
|
+
{
|
|
51
|
+
'@id': 'Topics',
|
|
52
|
+
items: [
|
|
53
|
+
{
|
|
54
|
+
'@id': 'At-a-glance',
|
|
55
|
+
description: '',
|
|
56
|
+
items: [
|
|
57
|
+
{
|
|
58
|
+
'@id': 'State-of-Europe’s-environment',
|
|
59
|
+
description: '',
|
|
60
|
+
items: [],
|
|
61
|
+
review_state: null,
|
|
62
|
+
title: 'State of Europe’s environment',
|
|
63
|
+
url: '/#',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
'@id': 'Climate',
|
|
67
|
+
description: '',
|
|
68
|
+
items: [],
|
|
69
|
+
review_state: null,
|
|
70
|
+
title: 'Climate',
|
|
71
|
+
url: '/#',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
'@id': 'Economy-and-resources',
|
|
75
|
+
description: '',
|
|
76
|
+
items: [],
|
|
77
|
+
review_state: null,
|
|
78
|
+
title: 'Economy and resources',
|
|
79
|
+
url: '/#',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
'@id': 'Health',
|
|
83
|
+
description: '',
|
|
84
|
+
items: [],
|
|
85
|
+
review_state: null,
|
|
86
|
+
title: 'Health',
|
|
87
|
+
url: '/#',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
'@id': 'Nature',
|
|
91
|
+
description: '',
|
|
92
|
+
items: [],
|
|
93
|
+
review_state: null,
|
|
94
|
+
title: 'Nature',
|
|
95
|
+
url: '/#',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
'@id': 'Sustainability',
|
|
99
|
+
description: '',
|
|
100
|
+
items: [],
|
|
101
|
+
review_state: null,
|
|
102
|
+
title: 'Sustainability',
|
|
103
|
+
url: '/#',
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
review_state: null,
|
|
107
|
+
title: 'At a glance',
|
|
108
|
+
url: '/#',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
review_state: null,
|
|
112
|
+
title: 'Topics',
|
|
113
|
+
url: '/#',
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
describe('Default component', () => {
|
|
118
|
+
const args = {
|
|
119
|
+
linksMenuTitle: 'Environmental information systems',
|
|
120
|
+
tabletLinksMenuTitle: 'EEA information systems',
|
|
121
|
+
mobileLinksMenuTitle: 'EEA information systems',
|
|
122
|
+
hasLanguageDropdown: true,
|
|
123
|
+
links,
|
|
124
|
+
languages,
|
|
125
|
+
menuItems,
|
|
126
|
+
transparency: false,
|
|
127
|
+
inverted: false,
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
it('renders the default with correct number of cards', () => {
|
|
131
|
+
const { container, getByText } = render(
|
|
132
|
+
<Router history={history}>
|
|
133
|
+
<Default {...args} />
|
|
134
|
+
</Router>,
|
|
135
|
+
);
|
|
136
|
+
const dropdown = container.querySelector('.official-union .content');
|
|
137
|
+
fireEvent.click(dropdown);
|
|
138
|
+
act(() => {
|
|
139
|
+
fireEvent(window, new Event('resize'));
|
|
140
|
+
});
|
|
141
|
+
expect(getByText('EEA Main Portal')).toBeInTheDocument();
|
|
142
|
+
expect(
|
|
143
|
+
getByText('Biodiversity Information System for Europe'),
|
|
144
|
+
).toBeInTheDocument();
|
|
145
|
+
expect(
|
|
146
|
+
getByText('Forest Information System for Europe'),
|
|
147
|
+
).toBeInTheDocument();
|
|
148
|
+
expect(
|
|
149
|
+
getByText('Marine Water Information System for Europe'),
|
|
150
|
+
).toBeInTheDocument();
|
|
151
|
+
expect(
|
|
152
|
+
getByText('Fresh Water Information System for Europe'),
|
|
153
|
+
).toBeInTheDocument();
|
|
154
|
+
|
|
155
|
+
fireEvent.click(container.querySelector('a[href="/#bise"]'));
|
|
156
|
+
fireEvent.click(container.querySelector('.language-link'));
|
|
157
|
+
});
|
|
158
|
+
});
|