gatsby-core-theme 44.19.2 → 44.20.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 CHANGED
@@ -1,3 +1,19 @@
1
+ # [44.20.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.19.2...v44.20.0) (2026-04-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix odds software id ([336729c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/336729c7b3e23123a1080bdbe0acc3d092d01b09))
7
+ * fix tests for operators.mjs ([b6704af](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b6704afbf8d76eab82d4bfff22dafaf398e199d0))
8
+
9
+
10
+ * Merge branch 'EN-408/add-odds-data' into 'master' ([173f818](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/173f81822d669b6c5e0ca08143cd7ac5c0649339))
11
+
12
+
13
+ ### Features
14
+
15
+ * add odds new data for sportsbook type ([96d45ca](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/96d45ca44c29f1114dfe0fb2cdb955b84837e76b))
16
+
1
17
  ## [44.19.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.19.1...v44.19.2) (2026-04-02)
2
18
 
3
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.19.2",
3
+ "version": "44.20.0",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -137,12 +137,11 @@ export const pickRelationKeys = {
137
137
  'rating_comments',
138
138
  'toplist_bonus',
139
139
  'toplist_item_tracker_name',
140
- 'odds_types',
141
140
  'odds_provider',
142
141
  'live_streaming',
143
- 'sport_competitions_ids',
144
142
  'betting_types',
145
- 'betting_features'
143
+ 'betting_features',
144
+ 'sport_categories'
146
145
  ],
147
146
  operator_simplified: [
148
147
  "short_name",
@@ -117,6 +117,15 @@ export function transformOperators(jsonData, relationsData, pages) {
117
117
  type: operatorType,
118
118
  };
119
119
 
120
+ newOperatorData.live_streaming = generalData.live_streaming;
121
+
122
+ // Odds providers
123
+ newOperatorData.odds_provider = generalData.odds_software_id
124
+ ? processProviders([generalData.odds_software_id], relationsData.providers)
125
+ .map((provider) => provider?.name)
126
+ .filter(Boolean)
127
+ : [];
128
+
120
129
  // OPERATOR LOGO (temp fix included and will be removed)
121
130
  newOperatorData.logo = processLogo(
122
131
  newOperatorData.logo,
@@ -1,11 +1,22 @@
1
1
  import { cleanup } from "@testing-library/react";
2
- import { sanitizeOperatorData } from "./operators.mjs";
2
+ import { sanitizeOperatorData, transformOperators } from "./operators.mjs";
3
3
  import {
4
4
  getRelationsData,
5
5
  getTransformedV2operator,
6
6
  } from "../../tests/factories/relations/operatorV2.factory";
7
7
  import getPageDataList from "../../tests/factories/pages/list.factory";
8
8
 
9
+ jest.mock("./relations.mjs", () => ({
10
+ processLogo: jest.fn((logo) => logo || null),
11
+ processPaymentMethods: jest.fn(() => []),
12
+ processCountries: jest.fn(() => []),
13
+ processCurrencies: jest.fn(() => []),
14
+ processProviders: jest.fn((ids) =>
15
+ ids?.includes(956) ? [{ id: 956, name: "18Peaches" }] : []
16
+ ),
17
+ processGamblingCompanies: jest.fn(() => null),
18
+ }));
19
+
9
20
  describe("Sanitize Operator Data", () => {
10
21
  test("Sanitize Data with Operator Page", () => {
11
22
  const operatorData = getTransformedV2operator();
@@ -46,10 +57,127 @@ expect(result.name).toBe("Test Casino");
46
57
  expect(result.url).toBe("/test-url");
47
58
  expect(result.ribbons).toEqual(["customLabel", "fromRelations"]);
48
59
  expect(result.author_name).toBeUndefined();
49
-
50
60
  });
51
61
  });
52
62
 
63
+ describe("transformOperators", () => {
64
+ test("uses live_streaming from general_data", () => {
65
+ const jsonData = {
66
+ bet365sb: {
67
+ general_data: {
68
+ id: 142,
69
+ name: "bet365",
70
+ short_name: "bet365sb",
71
+ live_streaming: true,
72
+ odds_software_id: null,
73
+ game_provider_ids: [],
74
+ currency_ids: [],
75
+ country_ids: [],
76
+ gambling_company_id: null,
77
+ },
78
+ markets_data: {
79
+ gb_en: {
80
+ sportsbook: {
81
+ live_streaming: false,
82
+ },
83
+ },
84
+ },
85
+ sites_data: {
86
+ gb_en: {
87
+ sportsbook: {
88
+ id: 45587,
89
+ market: "gb_en",
90
+ operator_id: 142,
91
+ status: "active",
92
+ },
93
+ },
94
+ },
95
+ },
96
+ };
97
+
98
+ const relationsData = {
99
+ providers: {},
100
+ payments: {},
101
+ currencies: {},
102
+ gamblingCompanies: {},
103
+ countries: {},
104
+ games: {},
105
+ ribbons: {},
106
+ };
107
+
108
+ const pages = {
109
+ 1: {
110
+ relation_type: "operator",
111
+ type: "operator",
112
+ relation_id: 45587,
113
+ path: "sportsbook-review-test",
114
+ },
115
+ };
116
+
117
+ const result = transformOperators(jsonData, relationsData, pages);
118
+
119
+ expect(result[45587].live_streaming).toBe(true);
120
+ });
121
+
122
+ test("maps odds provider from general data odds software id", () => {
123
+ const jsonData = {
124
+ bet365sb: {
125
+ general_data: {
126
+ id: 142,
127
+ name: "bet365",
128
+ short_name: "bet365sb",
129
+ live_streaming: true,
130
+ odds_software_id: 956,
131
+ game_provider_ids: [],
132
+ currency_ids: [],
133
+ country_ids: [],
134
+ gambling_company_id: null,
135
+ },
136
+ markets_data: {
137
+ gb_en: {
138
+ sportsbook: {},
139
+ },
140
+ },
141
+ sites_data: {
142
+ gb_en: {
143
+ sportsbook: {
144
+ id: 45587,
145
+ market: "gb_en",
146
+ operator_id: 142,
147
+ status: "active",
148
+ },
149
+ },
150
+ },
151
+ },
152
+ };
153
+
154
+ const relationsData = {
155
+ providers: {
156
+ peaches: { id: 956, name: "18Peaches" },
157
+ },
158
+ payments: {},
159
+ currencies: {},
160
+ gamblingCompanies: {},
161
+ countries: {},
162
+ games: {},
163
+ ribbons: {},
164
+ };
165
+
166
+ const pages = {
167
+ 1: {
168
+ relation_type: "operator",
169
+ type: "operator",
170
+ relation_id: 45587,
171
+ path: "sportsbook-review-test",
172
+ },
173
+ };
174
+
175
+ const result = transformOperators(jsonData, relationsData, pages);
176
+
177
+ expect(result[45587].odds_provider).toEqual(["18Peaches"]);
178
+ });
179
+ });
180
+
53
181
  afterEach(() => {
54
182
  cleanup();
55
183
  });