gatsby-core-theme 44.10.1 → 44.10.12-beta.1
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/.ci.yml +1 -0
- package/CHANGELOG.md +101 -0
- package/gatsby-browser.js +3 -145
- package/gatsby-config.js +3 -3
- package/gatsby-node.mjs +7 -1
- package/gatsby-ssr.js +142 -0
- package/package.json +2 -1
- package/src/components/app-ssr.js +16 -18
- package/src/components/atoms/admin/bar/index.js +6 -2
- package/src/components/atoms/admin/button/index.js +4 -3
- package/src/components/atoms/contact-form/index.js +2 -2
- package/src/components/atoms/market-dropdown/index.js +7 -9
- package/src/components/atoms/notifications/index.js +2 -3
- package/src/components/atoms/ratings/index.js +7 -6
- package/src/components/atoms/review-link/index.js +16 -11
- package/src/components/atoms/search/autocomplete/article/index.js +13 -9
- package/src/components/atoms/search/autocomplete/default/index.js +13 -9
- package/src/components/atoms/search/autocomplete/game/index.js +22 -12
- package/src/components/atoms/search/autocomplete/operator/index.js +26 -18
- package/src/components/molecules/bonus/template-one/index.js +15 -2
- package/src/components/molecules/bonus/template-two/index.js +7 -1
- package/src/components/molecules/cookie-modal/index.js +1 -1
- package/src/components/molecules/floating-area/index.js +6 -12
- package/src/components/molecules/footer/index.js +35 -27
- package/src/components/molecules/footer/variants/template-one/template-one.stories.js +70 -67
- package/src/components/molecules/footer/variants/template-one/template-one.test.js +92 -69
- package/src/components/molecules/footer/variants/template-three/template-three.stories.js +4 -4
- package/src/components/molecules/footer/variants/template-three/template-three.test.js +98 -73
- package/src/components/molecules/footer/variants/template-two/template-two.stories.js +3 -3
- package/src/components/molecules/footer/variants/template-two/template-two.test.js +96 -73
- package/src/components/molecules/header/variants/default/template-one/index.js +15 -13
- package/src/components/molecules/header/variants/default/template-one/template-one.test.js +37 -29
- package/src/components/molecules/header/variants/slot/template-one/templateone.test.js +32 -29
- package/src/components/molecules/leave-comment-form/index.js +90 -79
- package/src/components/molecules/main/index.js +5 -7
- package/src/components/molecules/menu/index.js +28 -30
- package/src/components/molecules/newsletter/form/index.js +2 -2
- package/src/components/molecules/newsletter/index.js +23 -19
- package/src/components/molecules/tnc/index.js +4 -2
- package/src/components/organisms/anchor/template-two/index.js +33 -18
- package/src/components/organisms/footer-navigation/index.js +10 -9
- package/src/components/organisms/navigation/navigationContext.js +28 -4
- package/src/components/organisms/search/index.js +17 -4
- package/src/constants/ratings-constant.js +7 -9
- package/src/helpers/getters.mjs +3 -3
- package/src/helpers/processImageNode.js +38 -30
- package/src/helpers/processImageNode.test.js +33 -24
- package/src/helpers/replaceMedia.js +2 -2
- package/src/resolver/games.mjs +1 -1
- package/src/resolver/operators.mjs +23 -13
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import React from
|
|
2
|
+
import React from "react";
|
|
3
3
|
import {
|
|
4
4
|
Title,
|
|
5
5
|
Description,
|
|
6
6
|
Primary,
|
|
7
7
|
PRIMARY_STORY,
|
|
8
8
|
ArgsTable,
|
|
9
|
-
} from
|
|
10
|
-
import { getExtraField } from
|
|
11
|
-
import getFooterData from
|
|
12
|
-
import Security from
|
|
9
|
+
} from "@storybook/addon-docs/blocks";
|
|
10
|
+
import { getExtraField } from "~helpers/getters";
|
|
11
|
+
import getFooterData from "../../../../../../tests/factories/modules/footer.factory";
|
|
12
|
+
import Security from "~images/icons/security";
|
|
13
13
|
import logo from "../../../../../../static/images/logo.svg";
|
|
14
|
-
import dmca from
|
|
15
|
-
import TemplateThree from
|
|
14
|
+
import dmca from "../../../../../../static/images/dmca.png";
|
|
15
|
+
import TemplateThree from ".";
|
|
16
16
|
|
|
17
17
|
const footerData = getFooterData();
|
|
18
18
|
const helpText = `
|
|
@@ -31,119 +31,122 @@ const helpText = `
|
|
|
31
31
|
in order to get help.
|
|
32
32
|
</p>`;
|
|
33
33
|
|
|
34
|
-
const phoneNum =
|
|
34
|
+
const phoneNum = "- 89 241 5401";
|
|
35
35
|
|
|
36
36
|
export default {
|
|
37
|
-
title:
|
|
37
|
+
title: "Theme/Layout/Footer/Template One",
|
|
38
38
|
component: TemplateThree,
|
|
39
39
|
argTypes: {
|
|
40
40
|
footerLogos: {
|
|
41
|
-
name:
|
|
42
|
-
type: { name:
|
|
43
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
44
|
-
description:
|
|
41
|
+
name: "footerLogos",
|
|
42
|
+
type: { name: "object", required: true },
|
|
43
|
+
defaultValue: getExtraField(footerData?.extra_fields, "logos"),
|
|
44
|
+
description: "footer logos",
|
|
45
45
|
},
|
|
46
46
|
footerMenu: {
|
|
47
|
-
name:
|
|
48
|
-
type: { name:
|
|
49
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
50
|
-
description:
|
|
47
|
+
name: "footerMenu",
|
|
48
|
+
type: { name: "object", required: true },
|
|
49
|
+
defaultValue: getExtraField(footerData?.extra_fields, "links"),
|
|
50
|
+
description: "footer menu",
|
|
51
51
|
},
|
|
52
52
|
copyrightDisclaimer: {
|
|
53
|
-
name:
|
|
54
|
-
type: { name:
|
|
55
|
-
defaultValue: getExtraField(
|
|
56
|
-
|
|
53
|
+
name: "copyrightDisclaimer",
|
|
54
|
+
type: { name: "string", required: true },
|
|
55
|
+
defaultValue: getExtraField(
|
|
56
|
+
footerData?.extra_fields,
|
|
57
|
+
"copyright_disclaimer"
|
|
58
|
+
),
|
|
59
|
+
description: "copyright disclaimer",
|
|
57
60
|
},
|
|
58
61
|
showLinks: {
|
|
59
|
-
name:
|
|
60
|
-
type: { name:
|
|
62
|
+
name: "showLinks",
|
|
63
|
+
type: { name: "boolean", required: true },
|
|
61
64
|
defaultValue: true,
|
|
62
|
-
description:
|
|
65
|
+
description: "show footer links?",
|
|
63
66
|
},
|
|
64
67
|
asSeenOn: {
|
|
65
|
-
name:
|
|
66
|
-
type: { name:
|
|
67
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
68
|
-
description:
|
|
68
|
+
name: "asSeenOn",
|
|
69
|
+
type: { name: "object", required: true },
|
|
70
|
+
defaultValue: getExtraField(footerData?.extra_fields, "as_seen_on"),
|
|
71
|
+
description: "footer as seen on logos",
|
|
69
72
|
},
|
|
70
73
|
gamblingText: {
|
|
71
|
-
name:
|
|
72
|
-
type: { name:
|
|
73
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
74
|
-
description:
|
|
74
|
+
name: "gamblingText",
|
|
75
|
+
type: { name: "object", required: true },
|
|
76
|
+
defaultValue: getExtraField(footerData?.extra_fields, "gambling_text"),
|
|
77
|
+
description: "Gambling Text",
|
|
75
78
|
},
|
|
76
79
|
socialIcons: {
|
|
77
|
-
name:
|
|
78
|
-
type: { name:
|
|
79
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
80
|
-
description:
|
|
80
|
+
name: "socialIcons",
|
|
81
|
+
type: { name: "object", required: true },
|
|
82
|
+
defaultValue: getExtraField(footerData?.extra_fields, "social_icons"),
|
|
83
|
+
description: "footer logos",
|
|
81
84
|
},
|
|
82
85
|
hasFooterLinks: {
|
|
83
|
-
name:
|
|
84
|
-
type: { name:
|
|
86
|
+
name: "hasFooterLinks",
|
|
87
|
+
type: { name: "boolean", required: true },
|
|
85
88
|
defaultValue: false,
|
|
86
|
-
description:
|
|
89
|
+
description: "has footer links on mobile?",
|
|
87
90
|
},
|
|
88
91
|
hasDisclaimer: {
|
|
89
|
-
name:
|
|
90
|
-
type: { name:
|
|
92
|
+
name: "hasDisclaimer",
|
|
93
|
+
type: { name: "boolean", required: true },
|
|
91
94
|
defaultValue: true,
|
|
92
|
-
description:
|
|
95
|
+
description: "has Disclaimer?",
|
|
93
96
|
},
|
|
94
97
|
showCopyright: {
|
|
95
|
-
name:
|
|
96
|
-
type: { name:
|
|
98
|
+
name: "showCopyright",
|
|
99
|
+
type: { name: "boolean", required: true },
|
|
97
100
|
defaultValue: true,
|
|
98
|
-
description:
|
|
101
|
+
description: "show Copyright?",
|
|
99
102
|
},
|
|
100
103
|
helpText: {
|
|
101
|
-
name:
|
|
102
|
-
type: { name:
|
|
104
|
+
name: "helpText",
|
|
105
|
+
type: { name: "string", required: true },
|
|
103
106
|
defaultValue: helpText,
|
|
104
|
-
description:
|
|
107
|
+
description: "helpText",
|
|
105
108
|
},
|
|
106
109
|
phoneNum: {
|
|
107
|
-
name:
|
|
108
|
-
type: { name:
|
|
110
|
+
name: "phoneNum",
|
|
111
|
+
type: { name: "string", required: true },
|
|
109
112
|
defaultValue: phoneNum,
|
|
110
|
-
description:
|
|
113
|
+
description: "phone number",
|
|
111
114
|
},
|
|
112
115
|
logo: {
|
|
113
|
-
name:
|
|
114
|
-
type: { name:
|
|
116
|
+
name: "logo",
|
|
117
|
+
type: { name: "string", required: true },
|
|
115
118
|
defaultValue: logo,
|
|
116
|
-
description:
|
|
119
|
+
description: "site logo",
|
|
117
120
|
},
|
|
118
121
|
dmcaImage: {
|
|
119
|
-
name:
|
|
120
|
-
type: { name:
|
|
122
|
+
name: "dmcaImage",
|
|
123
|
+
type: { name: "string", required: true },
|
|
121
124
|
defaultValue: dmca,
|
|
122
|
-
description:
|
|
125
|
+
description: "site dmca image path",
|
|
123
126
|
},
|
|
124
127
|
dmcaWidth: {
|
|
125
|
-
name:
|
|
126
|
-
type: { name:
|
|
128
|
+
name: "dmcaWidth",
|
|
129
|
+
type: { name: "number", required: true },
|
|
127
130
|
defaultValue: 100,
|
|
128
|
-
description:
|
|
131
|
+
description: "site dmca image width",
|
|
129
132
|
},
|
|
130
133
|
dmcaHeight: {
|
|
131
|
-
name:
|
|
132
|
-
type: { name:
|
|
134
|
+
name: "dmcaImage",
|
|
135
|
+
type: { name: "number", required: true },
|
|
133
136
|
defaultValue: 33,
|
|
134
|
-
description:
|
|
137
|
+
description: "site dmca image height",
|
|
135
138
|
},
|
|
136
139
|
securityIcon: {
|
|
137
|
-
name:
|
|
138
|
-
type: { name:
|
|
140
|
+
name: "securityIcon",
|
|
141
|
+
type: { name: "element", required: true },
|
|
139
142
|
defaultValue: <Security />,
|
|
140
|
-
description:
|
|
143
|
+
description: "site security icon",
|
|
141
144
|
},
|
|
142
145
|
},
|
|
143
146
|
parameters: {
|
|
144
147
|
docs: {
|
|
145
148
|
description: {
|
|
146
|
-
component:
|
|
149
|
+
component: "A Default Footer Component - Template One",
|
|
147
150
|
},
|
|
148
151
|
page: () => (
|
|
149
152
|
<>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
|
2
|
-
import React from
|
|
3
|
-
import { render, cleanup, waitFor } from
|
|
4
|
-
import
|
|
5
|
-
import Footer from
|
|
6
|
-
import { getExtraField, copyrightText } from
|
|
7
|
-
import Security from
|
|
8
|
-
import getFooterData from
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { render, cleanup, waitFor } from "@testing-library/react";
|
|
4
|
+
import "@testing-library/jest-dom/extend-expect";
|
|
5
|
+
import Footer from ".";
|
|
6
|
+
import { getExtraField, copyrightText } from "../../../../../helpers/getters";
|
|
7
|
+
import Security from "~images/icons/security";
|
|
8
|
+
import getFooterData from "../../../../../../tests/factories/modules/footer.factory";
|
|
9
9
|
|
|
10
10
|
const helpText = `
|
|
11
11
|
<p>
|
|
@@ -17,7 +17,7 @@ const helpText = `
|
|
|
17
17
|
</a>
|
|
18
18
|
in order to get help.
|
|
19
19
|
</p>`;
|
|
20
|
-
const phoneNum =
|
|
20
|
+
const phoneNum = "- 89 241 5401";
|
|
21
21
|
|
|
22
22
|
const dmcaImg = (
|
|
23
23
|
<img
|
|
@@ -43,18 +43,21 @@ let footerLogos;
|
|
|
43
43
|
|
|
44
44
|
beforeEach(() => {
|
|
45
45
|
data = getFooterData();
|
|
46
|
-
footerMenu = getExtraField(data?.extra_fields,
|
|
47
|
-
asSeenOn = getExtraField(data?.extra_fields,
|
|
48
|
-
gamblingText = getExtraField(data?.extra_fields,
|
|
49
|
-
socialIcons = getExtraField(data?.extra_fields,
|
|
50
|
-
copyrightDisclaimer = getExtraField(
|
|
51
|
-
|
|
46
|
+
footerMenu = getExtraField(data?.extra_fields, "links");
|
|
47
|
+
asSeenOn = getExtraField(data?.extra_fields, "as_seen_on");
|
|
48
|
+
gamblingText = getExtraField(data?.extra_fields, "gambling_text");
|
|
49
|
+
socialIcons = getExtraField(data?.extra_fields, "social_icons");
|
|
50
|
+
copyrightDisclaimer = getExtraField(
|
|
51
|
+
data.extra_fields,
|
|
52
|
+
"copyright_disclaimer"
|
|
53
|
+
);
|
|
54
|
+
footerLogos = getExtraField(data?.extra_fields, "logos");
|
|
52
55
|
|
|
53
56
|
props = {
|
|
54
57
|
section: data,
|
|
55
|
-
template:
|
|
58
|
+
template: "default",
|
|
56
59
|
hasFooterLinks: false,
|
|
57
|
-
footerTemplate:
|
|
60
|
+
footerTemplate: "template_one",
|
|
58
61
|
showLinks: true,
|
|
59
62
|
copyrightDisclaimer,
|
|
60
63
|
footerLogos,
|
|
@@ -64,79 +67,89 @@ beforeEach(() => {
|
|
|
64
67
|
socialIcons,
|
|
65
68
|
hasDisclaimer: true,
|
|
66
69
|
showCopyright: true,
|
|
67
|
-
logo:
|
|
70
|
+
logo: "/images/logo.svg",
|
|
68
71
|
securityIcon: <Security />,
|
|
69
72
|
helpText,
|
|
70
73
|
phoneNum,
|
|
71
74
|
dmcaImg,
|
|
72
75
|
};
|
|
73
76
|
});
|
|
74
|
-
describe(
|
|
75
|
-
test(
|
|
77
|
+
describe("Show Footer", () => {
|
|
78
|
+
test("render with props", () => {
|
|
76
79
|
const { container } = renderComponent(props);
|
|
77
80
|
expect(container).toBeTruthy();
|
|
78
81
|
});
|
|
79
|
-
test(
|
|
82
|
+
test("show correct template ", async () => {
|
|
80
83
|
const { container } = renderComponent(props);
|
|
81
84
|
await waitFor(() => {
|
|
82
|
-
expect(container.querySelectorAll(
|
|
85
|
+
expect(container.querySelectorAll(".footer.templateOne").length).toBe(1);
|
|
83
86
|
});
|
|
84
87
|
});
|
|
85
|
-
test(
|
|
88
|
+
test("show as seen on", async () => {
|
|
86
89
|
const { container, getByText } = renderComponent(props);
|
|
87
90
|
await waitFor(() => {
|
|
88
|
-
expect(container.querySelectorAll(
|
|
89
|
-
expect(container.querySelectorAll(
|
|
91
|
+
expect(container.querySelectorAll("footer > div")).toHaveLength(2);
|
|
92
|
+
expect(container.querySelectorAll(".asSeenOn")).toHaveLength(1);
|
|
90
93
|
|
|
91
94
|
// show correct title
|
|
92
|
-
expect(getByText(
|
|
95
|
+
expect(getByText("As Seen On:")).toHaveTextContent(`${asSeenOn.title}:`);
|
|
93
96
|
|
|
94
97
|
// show correct number of logos
|
|
95
|
-
expect(container.querySelectorAll(
|
|
98
|
+
expect(container.querySelectorAll(".asSeenOn li")).toHaveLength(3);
|
|
96
99
|
});
|
|
97
100
|
});
|
|
98
101
|
|
|
99
|
-
test(
|
|
102
|
+
test("render menu list", async () => {
|
|
100
103
|
const { container, getByText } = renderComponent(props);
|
|
101
104
|
|
|
102
105
|
await waitFor(() => {
|
|
103
|
-
expect(container.querySelectorAll(
|
|
104
|
-
expect(container.querySelectorAll(
|
|
105
|
-
expect(container.querySelectorAll(
|
|
106
|
+
expect(container.querySelectorAll(".topPart")).toHaveLength(1);
|
|
107
|
+
expect(container.querySelectorAll(".links")).toHaveLength(1);
|
|
108
|
+
expect(container.querySelectorAll(".links ul")).toHaveLength(
|
|
109
|
+
footerMenu.children.length
|
|
110
|
+
);
|
|
106
111
|
|
|
107
112
|
// show correct title
|
|
108
113
|
expect(getByText(footerMenu.children[0].title)).toBeTruthy();
|
|
109
114
|
expect(getByText(footerMenu.children[2].title)).toBeTruthy();
|
|
110
115
|
|
|
111
116
|
// show correct number of child lists
|
|
112
|
-
expect(
|
|
113
|
-
|
|
117
|
+
expect(
|
|
118
|
+
getByText(footerMenu.children[1].title).closest("ul").children
|
|
119
|
+
).toHaveLength(7);
|
|
120
|
+
expect(
|
|
121
|
+
getByText(footerMenu.children[3].title).closest("ul").children
|
|
122
|
+
).toHaveLength(5);
|
|
114
123
|
|
|
115
124
|
// show correct url
|
|
116
125
|
expect(
|
|
117
|
-
getByText(footerMenu.children[1].children[0].title)
|
|
126
|
+
getByText(footerMenu.children[1].children[0].title)
|
|
127
|
+
.closest("a")
|
|
128
|
+
.getAttribute("href")
|
|
118
129
|
).toEqual(`/${footerMenu.children[1].children[0].value}`);
|
|
119
130
|
expect(
|
|
120
|
-
getByText(footerMenu.children[2].children[2].title)
|
|
131
|
+
getByText(footerMenu.children[2].children[2].title)
|
|
132
|
+
.closest("a")
|
|
133
|
+
.getAttribute("href")
|
|
121
134
|
).toEqual(`/${footerMenu.children[2].children[2].value}`);
|
|
122
135
|
});
|
|
123
136
|
});
|
|
124
|
-
test(
|
|
137
|
+
test("hide menu list", async () => {
|
|
125
138
|
props = {
|
|
126
139
|
...props,
|
|
127
140
|
showLinks: false,
|
|
128
141
|
};
|
|
129
142
|
const { container } = renderComponent(props);
|
|
130
143
|
await waitFor(() => {
|
|
131
|
-
expect(container.querySelectorAll(
|
|
132
|
-
expect(container.querySelectorAll(
|
|
144
|
+
expect(container.querySelectorAll(".links")).toHaveLength(0);
|
|
145
|
+
expect(container.querySelectorAll(".links ul")).toHaveLength(0);
|
|
133
146
|
});
|
|
134
147
|
});
|
|
135
|
-
test(
|
|
148
|
+
test("hide gambling text", async () => {
|
|
136
149
|
const { container } = renderComponent(props);
|
|
137
150
|
await waitFor(() => {
|
|
138
|
-
expect(container.querySelectorAll(
|
|
139
|
-
expect(container.querySelectorAll(
|
|
151
|
+
expect(container.querySelectorAll(".license > div")).toHaveLength(3);
|
|
152
|
+
expect(container.querySelectorAll(".gamblingText")).toHaveLength(0);
|
|
140
153
|
});
|
|
141
154
|
});
|
|
142
155
|
// test('correct security text', async () => {
|
|
@@ -149,72 +162,82 @@ describe('Show Footer', () => {
|
|
|
149
162
|
// ).toContain('securityText');
|
|
150
163
|
// });
|
|
151
164
|
// });
|
|
152
|
-
test(
|
|
165
|
+
test("footer middle part does not show another as seen on", async () => {
|
|
153
166
|
const { container } = renderComponent(props);
|
|
154
167
|
await waitFor(() => {
|
|
155
|
-
expect(container.querySelectorAll(
|
|
156
|
-
|
|
168
|
+
expect(container.querySelectorAll(".footerHotline > div")).toHaveLength(
|
|
169
|
+
1
|
|
170
|
+
);
|
|
171
|
+
expect(
|
|
172
|
+
container.querySelectorAll(".footerHotline .asSeenOn")
|
|
173
|
+
).toHaveLength(0);
|
|
157
174
|
});
|
|
158
175
|
});
|
|
159
|
-
test(
|
|
176
|
+
test("correct help text", async () => {
|
|
160
177
|
const { container } = renderComponent(props);
|
|
161
178
|
await waitFor(() => {
|
|
162
|
-
expect(container.querySelector(
|
|
163
|
-
expect(container.querySelector(
|
|
179
|
+
expect(container.querySelector(".helpText")).toBeTruthy();
|
|
180
|
+
expect(container.querySelector(".helpText").innerHTML).toBe(helpText);
|
|
164
181
|
});
|
|
165
182
|
});
|
|
166
|
-
test(
|
|
183
|
+
test("correct phone number", async () => {
|
|
167
184
|
const { getByText, container } = renderComponent(props);
|
|
168
185
|
await waitFor(() => {
|
|
169
186
|
expect(getByText(phoneNum)).toBeTruthy();
|
|
170
|
-
expect(
|
|
187
|
+
expect(
|
|
188
|
+
container.querySelector(".phoneNum").innerHTML.split("</svg>")[1]
|
|
189
|
+
).toBe(phoneNum);
|
|
171
190
|
});
|
|
172
191
|
});
|
|
173
|
-
test(
|
|
192
|
+
test("show copyright disclaimer", async () => {
|
|
174
193
|
const { container } = renderComponent(props);
|
|
175
194
|
await waitFor(() => {
|
|
176
|
-
expect(container.querySelectorAll(
|
|
195
|
+
expect(container.querySelectorAll(".copyrightDisclaimer")).toBeTruthy();
|
|
177
196
|
|
|
178
|
-
expect(container.querySelector(
|
|
197
|
+
expect(container.querySelector(".copyrightDisclaimer").innerHTML).toBe(
|
|
198
|
+
copyrightDisclaimer
|
|
199
|
+
);
|
|
179
200
|
});
|
|
180
201
|
});
|
|
181
|
-
test(
|
|
202
|
+
test("show copyright", async () => {
|
|
182
203
|
const { container } = renderComponent(props);
|
|
183
204
|
await waitFor(() => {
|
|
184
|
-
expect(container.querySelector(
|
|
205
|
+
expect(container.querySelector(".copyrightText")).toHaveTextContent(
|
|
206
|
+
copyrightText()
|
|
207
|
+
);
|
|
185
208
|
});
|
|
186
209
|
});
|
|
187
|
-
test(
|
|
210
|
+
test("hide copyright", async () => {
|
|
188
211
|
props = {
|
|
189
212
|
...props,
|
|
190
213
|
showCopyright: false,
|
|
191
214
|
};
|
|
192
215
|
const { container } = renderComponent(props);
|
|
193
216
|
await waitFor(() => {
|
|
194
|
-
expect(container.querySelector(
|
|
217
|
+
expect(container.querySelector(".copyrightText")).toBeFalsy();
|
|
195
218
|
});
|
|
196
219
|
});
|
|
197
|
-
test(
|
|
220
|
+
test("show dmca image", async () => {
|
|
198
221
|
// eslint-disable-next-line global-require
|
|
199
|
-
const func = require(
|
|
222
|
+
const func = require("~helpers/device-detect");
|
|
200
223
|
func.isNativeImageLazyLoadingSupported = jest.fn(() => true);
|
|
201
224
|
props = {
|
|
202
225
|
...props,
|
|
203
226
|
showCopyright: false,
|
|
204
|
-
dmcaImage:
|
|
227
|
+
dmcaImage: "/images/dmca.png",
|
|
205
228
|
};
|
|
206
229
|
const { container } = renderComponent(props);
|
|
207
|
-
expect(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
);
|
|
230
|
+
expect(
|
|
231
|
+
container.querySelector(".logos > a").querySelector("img")
|
|
232
|
+
).toBeTruthy();
|
|
233
|
+
expect(
|
|
234
|
+
container.querySelector(".logos > a").querySelector("img")
|
|
235
|
+
).toHaveAttribute("src", "/images/dmca.png");
|
|
236
|
+
expect(
|
|
237
|
+
container.querySelector(".logos > a").querySelector("img")
|
|
238
|
+
).toHaveAttribute("loading", "lazy");
|
|
216
239
|
});
|
|
217
|
-
test(
|
|
240
|
+
test("hide dmca image", async () => {
|
|
218
241
|
props = {
|
|
219
242
|
...props,
|
|
220
243
|
hasDisclaimer: false,
|
|
@@ -222,7 +245,7 @@ describe('Show Footer', () => {
|
|
|
222
245
|
};
|
|
223
246
|
const { container } = renderComponent(props);
|
|
224
247
|
await waitFor(() => {
|
|
225
|
-
expect(container.querySelector(
|
|
248
|
+
expect(container.querySelector(".logos > a")).toBeFalsy();
|
|
226
249
|
});
|
|
227
250
|
});
|
|
228
251
|
});
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
PRIMARY_STORY,
|
|
8
8
|
ArgsTable,
|
|
9
9
|
} from "@storybook/addon-docs/blocks";
|
|
10
|
-
import { getExtraField } from "
|
|
10
|
+
import { getExtraField } from "~helpers/getters";
|
|
11
11
|
import getFooterData from "../../../../../../tests/factories/modules/footer.factory";
|
|
12
|
-
import logo from
|
|
13
|
-
import Security from
|
|
14
|
-
import dmca from
|
|
12
|
+
import logo from "../../../../../../static/images/logo.svg";
|
|
13
|
+
import Security from "~images/icons/security";
|
|
14
|
+
import dmca from "../../../../../../static/images/dmca.png";
|
|
15
15
|
import TemplateThree from ".";
|
|
16
16
|
|
|
17
17
|
const footerData = getFooterData();
|