@griddo/ax 1.71.0 → 1.72.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/package.json +2 -2
- package/src/Style/index.tsx +1 -1
- package/src/__tests__/components/ElementsTooltip/ElementsTooltip.test.tsx +1 -1
- package/src/__tests__/components/EmptyState/EmptyState.test.tsx +1 -1
- package/src/__tests__/components/FieldContainer/FieldContainer.test.tsx +82 -0
- package/src/__tests__/components/Fields/AnalyticsField/AnalyticsField.test.tsx +1 -1
- package/src/__tests__/components/Fields/AnalyticsField/PageAnalytics/PageAnalytics.test.tsx +1 -1
- package/src/__tests__/components/Fields/AnalyticsField/StructuredDataAnalytics/StructuredDataAnalytics.test.tsx +1 -1
- package/src/__tests__/components/Fields/ArrayFieldGroup/ArrayFieldGroup.test.tsx +2 -2
- package/src/__tests__/components/Fields/AsyncCheckGroup/AsyncCheckGroup.test.tsx +3 -3
- package/src/__tests__/components/Fields/AsyncSelect/AsyncSelect.test.tsx +1 -1
- package/src/__tests__/components/Fields/CheckField/CheckField.test.tsx +6 -6
- package/src/__tests__/components/Fields/CheckGroup/CheckGroup.test.tsx +15 -15
- package/src/__tests__/components/Fields/ColorPicker/ColorPicker.test.tsx +6 -6
- package/src/__tests__/components/Fields/ComponentArray/ComponentArray.test.tsx +1 -1
- package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/MixableComponentArray.test.tsx +7 -7
- package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/PasteModuleButton/PasteModuleButton.test.tsx +9 -9
- package/src/__tests__/components/Fields/ComponentArray/SameComponentArray/SameComponentArray.test.tsx +5 -5
- package/src/__tests__/components/Fields/ComponentContainer/ComponentContainer.test.tsx +1 -1
- package/src/__tests__/components/Fields/ConditionalField/ConditionalField.test.tsx +1 -1
- package/src/__tests__/components/Fields/DateField/DateField.test.tsx +1 -1
- package/src/__tests__/components/Fields/FieldGroup/FieldGroup.test.tsx +1 -1
- package/src/__tests__/components/Fields/FieldsDivider/FieldsDivider.test.tsx +1 -1
- package/src/__tests__/components/Fields/FileField/FileField.test.tsx +3 -3
- package/src/__tests__/components/Fields/HeadingField/HeadingField.test.tsx +6 -6
- package/src/__tests__/components/Fields/HiddenField/HiddenField.test.tsx +1 -1
- package/src/__tests__/components/Fields/ImageField/ImageField.test.tsx +3 -3
- package/src/__tests__/components/Fields/MultiCheckSelect/MultiCheckSelect.test.tsx +1 -1
- package/src/__tests__/components/Fields/MultiCheckSelectGroup/MultiCheckSelectGroup.test.tsx +2 -2
- package/src/__tests__/components/Fields/NoteField/NoteField.test.tsx +1 -1
- package/src/__tests__/components/Fields/NumberField/NumberField.test.tsx +1 -1
- package/src/__tests__/components/Fields/RadioField/RadioField.test.tsx +1 -1
- package/src/__tests__/components/Fields/ReferenceField/ReferenceField.test.tsx +96 -8
- package/src/__tests__/components/Fields/RichText/RichText.test.tsx +1 -1
- package/src/__tests__/components/Fields/Select/Select.test.tsx +2 -2
- package/src/__tests__/components/Fields/SliderField/SliderField.test.tsx +1 -1
- package/src/__tests__/components/Fields/TagField/TagField.test.tsx +1 -1
- package/src/__tests__/components/Fields/TextArea/TextArea.test.tsx +1 -1
- package/src/__tests__/components/Fields/TextField/TextField.test.tsx +6 -6
- package/src/__tests__/components/Fields/TimeField/HourInput/HourInput.test.tsx +1 -1
- package/src/__tests__/components/Fields/TimeField/TimeField.test.tsx +1 -1
- package/src/__tests__/components/Fields/ToggleField/ToggleField.test.tsx +1 -1
- package/src/__tests__/components/Fields/Tooltip/Tooltip.test.tsx +3 -2
- package/src/__tests__/components/Fields/UniqueCheck/UniqueCheck.test.tsx +3 -3
- package/src/__tests__/components/Fields/UrlField/UrlField.test.tsx +4 -4
- package/src/__tests__/components/Fields/VisualUniqueSelection/ImageSelection/ImageSelection.test.tsx +1 -1
- package/src/__tests__/components/Fields/VisualUniqueSelection/ScrollableSelection/ScrollableSelection.test.tsx +3 -3
- package/src/__tests__/components/Fields/VisualUniqueSelection/VisualUniqueSelection.test.tsx +1 -1
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.test.tsx +1 -1
- package/src/__tests__/components/FieldsBehavior/FieldsBehavior.test.tsx +149 -0
- package/src/__tests__/components/TableFilters/CategoryFilter/CategoryFilter.test.tsx +241 -0
- package/src/__tests__/components/TableFilters/CustomizeFilters/CustomizeFilters.test.tsx +131 -0
- package/src/__tests__/components/TableFilters/DateFilter/DateFilter.test.tsx +148 -0
- package/src/__tests__/components/TableFilters/LiveFilter/LiveFilter.test.tsx +265 -0
- package/src/__tests__/components/TableFilters/NameFilter/NameFilter.test.tsx +197 -0
- package/src/__tests__/components/TableFilters/SiteFilter/SiteFilter.test.tsx +317 -0
- package/src/__tests__/components/TableFilters/StatusFilter/StatusFilter.test.tsx +197 -0
- package/src/__tests__/components/TableFilters/TranslationsFilter/TranslationsFilter.test.tsx +157 -0
- package/src/__tests__/components/TableFilters/TypeFilter/TypeFilter.test.tsx +164 -0
- package/src/__tests__/components/TableList/TableList.test.tsx +2 -2
- package/src/__tests__/components/Tabs/Tabs.test.tsx +36 -33
- package/src/__tests__/components/Tag/Tag.test.tsx +4 -2
- package/src/__tests__/components/Toast/Toast.test.tsx +4 -2
- package/src/components/FieldContainer/index.tsx +3 -3
- package/src/components/Fields/CheckField/index.tsx +3 -3
- package/src/components/Fields/CheckGroup/index.tsx +2 -2
- package/src/components/Fields/HeadingField/index.tsx +1 -1
- package/src/components/Fields/Select/index.tsx +1 -1
- package/src/components/Fields/TextField/index.tsx +2 -7
- package/src/components/FieldsBehavior/index.tsx +1 -1
- package/src/components/FloatingMenu/index.tsx +1 -1
- package/src/components/IconAction/index.tsx +1 -1
- package/src/components/Lists/index.tsx +1 -1
- package/src/components/TableFilters/CategoryFilter/index.tsx +2 -2
- package/src/components/TableFilters/CategoryFilter/style.tsx +1 -10
- package/src/components/TableFilters/CustomizeFilters/index.tsx +2 -3
- package/src/components/TableFilters/DateFilter/index.tsx +4 -4
- package/src/components/TableFilters/LiveFilter/index.tsx +1 -1
- package/src/components/TableFilters/LiveFilter/style.tsx +2 -10
- package/src/components/TableFilters/NameFilter/index.tsx +4 -4
- package/src/components/TableFilters/SiteFilter/index.tsx +16 -13
- package/src/components/TableFilters/SiteFilter/style.tsx +1 -10
- package/src/components/TableFilters/StatusFilter/index.tsx +3 -3
- package/src/components/TableFilters/TranslationsFilter/index.tsx +4 -7
- package/src/components/TableFilters/TranslationsFilter/style.tsx +1 -10
- package/src/components/TableFilters/TypeFilter/index.tsx +2 -2
- package/src/components/TableFilters/TypeFilter/style.tsx +1 -10
- package/src/components/Tooltip/index.tsx +1 -1
- package/src/helpers/index.tsx +3 -0
- package/src/helpers/parseTheme.js +456 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import HeadingField from "@ax/components/Fields/HeadingField";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { render, screen, cleanup } from "@testing-library/react";
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ describe("HeadingField component rendering", () => {
|
|
|
31
31
|
</ThemeProvider>
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
-
const textFieldContainer = screen.getByTestId("
|
|
34
|
+
const textFieldContainer = screen.getByTestId("text-field-container");
|
|
35
35
|
|
|
36
36
|
expect(textFieldContainer).toBeTruthy();
|
|
37
37
|
});
|
|
@@ -58,10 +58,10 @@ describe("HeadingField component rendering", () => {
|
|
|
58
58
|
</ThemeProvider>
|
|
59
59
|
);
|
|
60
60
|
|
|
61
|
-
const textFieldContainer = screen.getByTestId("
|
|
62
|
-
const textFieldAdvancedWrapper = screen.getByTestId("
|
|
63
|
-
const contentWrapper = screen.getByTestId("
|
|
64
|
-
const selectComponent = screen.getByTestId("
|
|
61
|
+
const textFieldContainer = screen.getByTestId("text-field-container");
|
|
62
|
+
const textFieldAdvancedWrapper = screen.getByTestId("text-field-advanced-wrapper");
|
|
63
|
+
const contentWrapper = screen.getByTestId("fields-behavior-wrapper");
|
|
64
|
+
const selectComponent = screen.getByTestId("select-component");
|
|
65
65
|
|
|
66
66
|
expect(textFieldContainer).toBeTruthy();
|
|
67
67
|
expect(textFieldAdvancedWrapper).toBeTruthy();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import HiddenField, { IHiddenFieldProps } from "@ax/components/Fields/HiddenField";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { mock } from "jest-mock-extended";
|
|
7
7
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
@@ -9,7 +9,7 @@ import thunk from "redux-thunk";
|
|
|
9
9
|
import { render, screen, cleanup, fireEvent } from "../../../../../config/jest/test-utils";
|
|
10
10
|
|
|
11
11
|
import ImageField, { IImageFieldProps } from "@ax/components/Fields/ImageField";
|
|
12
|
-
import { parseTheme } from "@
|
|
12
|
+
import { parseTheme } from "@ax/helpers";
|
|
13
13
|
import globalTheme from "@ax/themes/theme.json";
|
|
14
14
|
|
|
15
15
|
afterEach(() => {
|
|
@@ -382,7 +382,7 @@ describe("ImageField triggers", () => {
|
|
|
382
382
|
{ store }
|
|
383
383
|
);
|
|
384
384
|
|
|
385
|
-
const iconActions = screen.getAllByTestId("
|
|
385
|
+
const iconActions = screen.getAllByTestId("icon-action-component");
|
|
386
386
|
expect(iconActions).toHaveLength(2);
|
|
387
387
|
|
|
388
388
|
fireEvent.click(iconActions[1]);
|
|
@@ -454,7 +454,7 @@ describe("ImageField triggers", () => {
|
|
|
454
454
|
{ store }
|
|
455
455
|
);
|
|
456
456
|
|
|
457
|
-
const iconActions = screen.getAllByTestId("
|
|
457
|
+
const iconActions = screen.getAllByTestId("icon-action-component");
|
|
458
458
|
expect(iconActions).toHaveLength(2);
|
|
459
459
|
|
|
460
460
|
fireEvent.click(iconActions[0]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ThemeProvider } from "styled-components";
|
|
3
|
-
import { parseTheme } from "@
|
|
3
|
+
import { parseTheme } from "@ax/helpers";
|
|
4
4
|
import globalTheme from "@ax/themes/theme.json";
|
|
5
5
|
import { mock } from "jest-mock-extended";
|
|
6
6
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
package/src/__tests__/components/Fields/MultiCheckSelectGroup/MultiCheckSelectGroup.test.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Axios from "axios";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { mock } from "jest-mock-extended";
|
|
7
7
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
@@ -101,7 +101,7 @@ describe("onChange events", () => {
|
|
|
101
101
|
|
|
102
102
|
rerender(Component);
|
|
103
103
|
|
|
104
|
-
const checkFieldInputs = screen.getAllByTestId("
|
|
104
|
+
const checkFieldInputs = screen.getAllByTestId("check-field-input");
|
|
105
105
|
|
|
106
106
|
await act(async () => {
|
|
107
107
|
fireEvent.click(checkFieldInputs[0]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import NoteField, { INoteFieldProps } from "@ax/components/Fields/NoteField";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { render, screen, cleanup } from "@testing-library/react";
|
|
7
7
|
import { mock } from "jest-mock-extended";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import NumberField, { INumberFieldProps } from "@ax/components/Fields/NumberField";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { mock } from "jest-mock-extended";
|
|
7
7
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import RadioField, { IRadioFieldProps } from "@ax/components/Fields/RadioField";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
7
7
|
import { mock } from "jest-mock-extended";
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import axios from "axios";
|
|
3
3
|
import "@testing-library/jest-dom";
|
|
4
4
|
import { ThemeProvider } from "styled-components";
|
|
5
|
-
import { parseTheme } from "@
|
|
5
|
+
import { parseTheme } from "@ax/helpers";
|
|
6
6
|
import { mock } from "jest-mock-extended";
|
|
7
7
|
import configureStore from "redux-mock-store";
|
|
8
8
|
|
|
@@ -216,7 +216,7 @@ describe("onChange events", () => {
|
|
|
216
216
|
|
|
217
217
|
const { rerender } = render(Component, { store });
|
|
218
218
|
|
|
219
|
-
let iconActionComponents = screen.getAllByTestId("
|
|
219
|
+
let iconActionComponents = screen.getAllByTestId("icon-action-component");
|
|
220
220
|
|
|
221
221
|
await act(async () => {
|
|
222
222
|
fireEvent.click(iconActionComponents[0]);
|
|
@@ -226,7 +226,7 @@ describe("onChange events", () => {
|
|
|
226
226
|
rerender(Component);
|
|
227
227
|
});
|
|
228
228
|
|
|
229
|
-
iconActionComponents = screen.getAllByTestId("
|
|
229
|
+
iconActionComponents = screen.getAllByTestId("icon-action-component");
|
|
230
230
|
|
|
231
231
|
await act(async () => {
|
|
232
232
|
fireEvent.click(iconActionComponents[2]);
|
|
@@ -282,7 +282,7 @@ describe("onChange events", () => {
|
|
|
282
282
|
let referenceFieldItems = screen.getAllByTestId("reference-field-item");
|
|
283
283
|
expect(referenceFieldItems.length).toBe(2);
|
|
284
284
|
|
|
285
|
-
const iconActionComponents = screen.getAllByTestId("
|
|
285
|
+
const iconActionComponents = screen.getAllByTestId("icon-action-component");
|
|
286
286
|
|
|
287
287
|
await act(async () => {
|
|
288
288
|
fireEvent.click(iconActionComponents[0]);
|
|
@@ -335,7 +335,7 @@ describe("onChange events", () => {
|
|
|
335
335
|
let referenceFieldItems = screen.getAllByTestId("reference-field-item");
|
|
336
336
|
expect(referenceFieldItems.length).toBe(2);
|
|
337
337
|
|
|
338
|
-
const iconActionComponents = screen.getAllByTestId("
|
|
338
|
+
const iconActionComponents = screen.getAllByTestId("icon-action-component");
|
|
339
339
|
|
|
340
340
|
await act(async () => {
|
|
341
341
|
fireEvent.click(iconActionComponents[0]);
|
|
@@ -403,7 +403,7 @@ describe("onChange events", () => {
|
|
|
403
403
|
|
|
404
404
|
const { rerender } = render(Component, { store });
|
|
405
405
|
|
|
406
|
-
const iconActionComponents = screen.getAllByTestId("
|
|
406
|
+
const iconActionComponents = screen.getAllByTestId("icon-action-component");
|
|
407
407
|
|
|
408
408
|
await act(async () => {
|
|
409
409
|
fireEvent.click(iconActionComponents[0]);
|
|
@@ -519,7 +519,95 @@ describe("onChange events", () => {
|
|
|
519
519
|
let referenceFieldItems = screen.getAllByTestId("reference-field-item");
|
|
520
520
|
expect(referenceFieldItems.length).toBe(2);
|
|
521
521
|
|
|
522
|
-
const iconActionComponents = screen.getAllByTestId("
|
|
522
|
+
const iconActionComponents = screen.getAllByTestId("icon-action-component");
|
|
523
|
+
|
|
524
|
+
await act(async () => {
|
|
525
|
+
fireEvent.click(iconActionComponents[2]);
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
await act(async () => {
|
|
529
|
+
rerender(Component);
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
const actionMenuItem = screen.getByTestId("action-menu-item");
|
|
533
|
+
await act(async () => {
|
|
534
|
+
fireEvent.click(actionMenuItem);
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
// await act(async () => {
|
|
538
|
+
// rerender(Component);
|
|
539
|
+
// });
|
|
540
|
+
|
|
541
|
+
referenceFieldItems = screen.getAllByTestId("reference-field-item");
|
|
542
|
+
=======
|
|
543
|
+
const referenceFieldItems = screen.getAllByTestId("reference-field-item");
|
|
544
|
+
>>>>>>> release/1.72
|
|
545
|
+
expect(referenceFieldItems[0]).toHaveTextContent("Article 02");
|
|
546
|
+
|
|
547
|
+
const droppable = screen.getByTestId("droppable");
|
|
548
|
+
expect(droppable).toBeTruthy();
|
|
549
|
+
|
|
550
|
+
fireEvent.dragStart(referenceFieldItems[0]);
|
|
551
|
+
fireEvent.dragEnter(droppable);
|
|
552
|
+
fireEvent.dragOver(droppable);
|
|
553
|
+
fireEvent.drop(droppable);
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
test("should render the drag handle if list length is greater than two", async () => {
|
|
557
|
+
defaultProps.source = ["ARTICLES"];
|
|
558
|
+
defaultProps.value = {
|
|
559
|
+
mode: "manual",
|
|
560
|
+
fixed: [4492, 4493],
|
|
561
|
+
};
|
|
562
|
+
const initialState = { ...initialStore, ...defaultProps };
|
|
563
|
+
const onChange = jest.fn();
|
|
564
|
+
|
|
565
|
+
mockApiCalls();
|
|
566
|
+
|
|
567
|
+
const Component = (
|
|
568
|
+
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
569
|
+
<ReferenceField {...initialState} onChange={onChange} />
|
|
570
|
+
</ThemeProvider>
|
|
571
|
+
);
|
|
572
|
+
|
|
573
|
+
const { rerender } = render(Component, { store });
|
|
574
|
+
|
|
575
|
+
await act(async () => {
|
|
576
|
+
rerender(Component);
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
const referenceFieldItems = screen.getAllByTestId("reference-field-item");
|
|
580
|
+
expect(referenceFieldItems.length).toBe(2);
|
|
581
|
+
const handleWrappers = screen.getAllByTestId("handle-wrapper");
|
|
582
|
+
expect(handleWrappers.length).toEqual(2);
|
|
583
|
+
});
|
|
584
|
+
|
|
585
|
+
test("should hide the drag handle if list length is lower than two", async () => {
|
|
586
|
+
defaultProps.source = ["ARTICLES"];
|
|
587
|
+
defaultProps.value = {
|
|
588
|
+
mode: "manual",
|
|
589
|
+
fixed: [],
|
|
590
|
+
};
|
|
591
|
+
const initialState = { ...initialStore, ...defaultProps };
|
|
592
|
+
const onChange = jest.fn();
|
|
593
|
+
|
|
594
|
+
mockApiCalls();
|
|
595
|
+
|
|
596
|
+
const Component = (
|
|
597
|
+
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
598
|
+
<ReferenceField {...initialState} onChange={onChange} />
|
|
599
|
+
</ThemeProvider>
|
|
600
|
+
);
|
|
601
|
+
|
|
602
|
+
const { rerender } = render(Component, { store });
|
|
603
|
+
|
|
604
|
+
await act(async () => {
|
|
605
|
+
rerender(Component);
|
|
606
|
+
});
|
|
607
|
+
let referenceFieldItems = screen.getAllByTestId("reference-field-item");
|
|
608
|
+
expect(referenceFieldItems.length).toBe(2);
|
|
609
|
+
|
|
610
|
+
const iconActionComponents = screen.getAllByTestId("icon-action-component");
|
|
523
611
|
|
|
524
612
|
await act(async () => {
|
|
525
613
|
fireEvent.click(iconActionComponents[2]);
|
|
@@ -568,7 +656,7 @@ describe("onChange events", () => {
|
|
|
568
656
|
let referenceFieldItems = screen.getAllByTestId("reference-field-item");
|
|
569
657
|
expect(referenceFieldItems.length).toBe(2);
|
|
570
658
|
|
|
571
|
-
const iconActionComponents = screen.getAllByTestId("
|
|
659
|
+
const iconActionComponents = screen.getAllByTestId("icon-action-component");
|
|
572
660
|
|
|
573
661
|
await act(async () => {
|
|
574
662
|
fireEvent.click(iconActionComponents[2]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import RichText, { IRichTextProps } from "@ax/components/Fields/RichText";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { mock } from "jest-mock-extended";
|
|
7
7
|
import { render, screen, cleanup } from "@testing-library/react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import Select, { ISelectProps } from "@ax/components/Fields/Select";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { render, screen, cleanup } from "@testing-library/react";
|
|
7
7
|
import { mock } from "jest-mock-extended";
|
|
@@ -24,7 +24,7 @@ describe("Select component rendering", () => {
|
|
|
24
24
|
<Select {...defaultProps} />
|
|
25
25
|
</ThemeProvider>
|
|
26
26
|
);
|
|
27
|
-
expect(screen.getByTestId("
|
|
27
|
+
expect(screen.getByTestId("select-component")).toBeTruthy();
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
test("should render the component with value selected", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import SliderField, { ITextFieldProps } from "@ax/components/Fields/SliderField";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
7
7
|
import { mock } from "jest-mock-extended";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import TagField from "@ax/components/Fields/TagField";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { render, screen, within, cleanup, fireEvent } from "@testing-library/react";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import TextArea from "@ax/components/Fields/TextArea";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import TextField from "@ax/components/Fields/TextField";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { render, screen, within, cleanup, fireEvent } from "@testing-library/react";
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@ describe("TextField component rendering", () => {
|
|
|
20
20
|
</ThemeProvider>
|
|
21
21
|
);
|
|
22
22
|
|
|
23
|
-
const textFieldContainer = screen.getByTestId("
|
|
23
|
+
const textFieldContainer = screen.getByTestId("text-field-container");
|
|
24
24
|
const inputComponent = screen.getByTestId("inputComponent");
|
|
25
25
|
|
|
26
26
|
expect(textFieldContainer).toBeTruthy();
|
|
@@ -40,7 +40,7 @@ describe("TextField component rendering", () => {
|
|
|
40
40
|
</ThemeProvider>
|
|
41
41
|
);
|
|
42
42
|
|
|
43
|
-
const textFieldContainer = screen.getByTestId("
|
|
43
|
+
const textFieldContainer = screen.getByTestId("text-field-container");
|
|
44
44
|
const inputComponent = screen.getByTestId("inputComponent");
|
|
45
45
|
const prefix = screen.getByTestId("prefix");
|
|
46
46
|
expect(textFieldContainer).toBeTruthy();
|
|
@@ -61,7 +61,7 @@ describe("TextField component rendering", () => {
|
|
|
61
61
|
</ThemeProvider>
|
|
62
62
|
);
|
|
63
63
|
|
|
64
|
-
const textFieldContainer = screen.getByTestId("
|
|
64
|
+
const textFieldContainer = screen.getByTestId("text-field-container");
|
|
65
65
|
const inputComponent = screen.getByTestId("inputComponent");
|
|
66
66
|
const backgroundIconComponent = screen.getByTestId("backgroundIconComponent");
|
|
67
67
|
|
|
@@ -83,7 +83,7 @@ describe("TextField component rendering", () => {
|
|
|
83
83
|
</ThemeProvider>
|
|
84
84
|
);
|
|
85
85
|
|
|
86
|
-
const textFieldContainer = screen.getByTestId("
|
|
86
|
+
const textFieldContainer = screen.getByTestId("text-field-container");
|
|
87
87
|
const inputComponent = screen.getByTestId("inputComponent");
|
|
88
88
|
const iconWrapperComponent = screen.getByTestId("iconWrapperComponent");
|
|
89
89
|
|
|
@@ -135,7 +135,7 @@ describe("onClick from buttons", () => {
|
|
|
135
135
|
|
|
136
136
|
const iconWrapperComponent = screen.getByTestId("iconWrapperComponent");
|
|
137
137
|
expect(iconWrapperComponent).toBeTruthy();
|
|
138
|
-
const iconActionComponent = within(iconWrapperComponent).getByTestId("
|
|
138
|
+
const iconActionComponent = within(iconWrapperComponent).getByTestId("icon-action-component");
|
|
139
139
|
expect(iconActionComponent).toBeTruthy();
|
|
140
140
|
fireEvent.click(iconActionComponent);
|
|
141
141
|
expect(onClickIconMock).toBeCalledTimes(1);
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
3
3
|
import { mock } from "jest-mock-extended";
|
|
4
4
|
import { ThemeProvider } from "styled-components";
|
|
5
|
-
import { parseTheme } from "@
|
|
5
|
+
import { parseTheme } from "@ax/helpers";
|
|
6
6
|
import globalTheme from "@ax/themes/theme.json";
|
|
7
7
|
import HourInput from "@ax/components/Fields/TimeField/HourInput";
|
|
8
8
|
import { act, Simulate } from "react-dom/test-utils";
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
3
3
|
import { mock } from "jest-mock-extended";
|
|
4
4
|
import { ThemeProvider } from "styled-components";
|
|
5
|
-
import { parseTheme } from "@
|
|
5
|
+
import { parseTheme } from "@ax/helpers";
|
|
6
6
|
import globalTheme from "@ax/themes/theme.json";
|
|
7
7
|
import { TimeField } from "@ax/components";
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import ToggleField, { IToggleFieldProps } from "@ax/components/Fields/ToggleField";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
7
7
|
import { mock } from "jest-mock-extended";
|
|
@@ -5,7 +5,7 @@ import { render, screen, cleanup, fireEvent, act } from "@testing-library/react"
|
|
|
5
5
|
import "@testing-library/jest-dom";
|
|
6
6
|
import { mock } from "jest-mock-extended";
|
|
7
7
|
|
|
8
|
-
import { parseTheme } from "@
|
|
8
|
+
import { parseTheme } from "@ax/helpers";
|
|
9
9
|
|
|
10
10
|
import Tooltip, { ITooltipProps } from "@ax/components/Tooltip";
|
|
11
11
|
import { Icon } from "@ax/components";
|
|
@@ -25,7 +25,7 @@ describe("Tooltip component rendering", () => {
|
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
const tooltipComponent = screen.getByTestId("tooltip-component");
|
|
28
|
-
const tipComponent = screen.getByTestId("
|
|
28
|
+
const tipComponent = screen.getByTestId("tip-component");
|
|
29
29
|
|
|
30
30
|
expect(tooltipComponent).toBeTruthy();
|
|
31
31
|
expect(tipComponent).toBeTruthy();
|
|
@@ -109,6 +109,7 @@ describe("Tooltip events triggering", () => {
|
|
|
109
109
|
|
|
110
110
|
const tooltipComponent = screen.getByTestId("tooltip-component");
|
|
111
111
|
const tipComponent = screen.queryByText("content");
|
|
112
|
+
const iconComponent = screen.getByTestId("icon-component");
|
|
112
113
|
|
|
113
114
|
defaultProps.hideOnClick = true;
|
|
114
115
|
rerender(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import UniqueCheck from "@ax/components/Fields/UniqueCheck";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import "@testing-library/jest-dom";
|
|
7
7
|
import { render, screen, cleanup } from "@testing-library/react";
|
|
@@ -35,9 +35,9 @@ describe("CheckField component rendering", () => {
|
|
|
35
35
|
</ThemeProvider>
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
const checkFieldLabel = screen.getByTestId("
|
|
38
|
+
const checkFieldLabel = screen.getByTestId("check-field-label");
|
|
39
39
|
|
|
40
|
-
expect(screen.getAllByTestId("
|
|
40
|
+
expect(screen.getAllByTestId("check-field-label")).toHaveLength(1);
|
|
41
41
|
expect(checkFieldLabel).toHaveTextContent("Option 1");
|
|
42
42
|
});
|
|
43
43
|
});
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
structuredDataResponse,
|
|
14
14
|
} from "../../../../__mocks__/mockedAxios";
|
|
15
15
|
|
|
16
|
-
import { parseTheme } from "@
|
|
16
|
+
import { parseTheme } from "@ax/helpers";
|
|
17
17
|
import UrlField, { IUrlFieldProps } from "@ax/components/Fields/UrlField/index";
|
|
18
18
|
import globalTheme from "@ax/themes/theme.json";
|
|
19
19
|
|
|
@@ -251,7 +251,7 @@ describe("UrlField component rendering", () => {
|
|
|
251
251
|
render(Component, { store });
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
-
expect(screen.getAllByTestId("
|
|
254
|
+
expect(screen.getAllByTestId("select-component")).toBeTruthy();
|
|
255
255
|
});
|
|
256
256
|
|
|
257
257
|
test("should render the select with tabs and subSlug", async () => {
|
|
@@ -290,7 +290,7 @@ describe("UrlField component rendering", () => {
|
|
|
290
290
|
render(Component, { store });
|
|
291
291
|
});
|
|
292
292
|
|
|
293
|
-
const selectComponents = screen.getAllByTestId("
|
|
293
|
+
const selectComponents = screen.getAllByTestId("select-component");
|
|
294
294
|
|
|
295
295
|
await act(async () => {
|
|
296
296
|
selectComponents[3].click();
|
|
@@ -431,7 +431,7 @@ describe("onClick events", () => {
|
|
|
431
431
|
});
|
|
432
432
|
|
|
433
433
|
const selectionListItem = screen.getAllByTestId("selection-list-item");
|
|
434
|
-
const checkFieldInputs = screen.getAllByTestId("
|
|
434
|
+
const checkFieldInputs = screen.getAllByTestId("check-field-input");
|
|
435
435
|
const pageField = screen.getByTestId("page-field");
|
|
436
436
|
|
|
437
437
|
await act(async () => {
|
package/src/__tests__/components/Fields/VisualUniqueSelection/ImageSelection/ImageSelection.test.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import ImageSelection, { IImageSelectionProps } from "@ax/components/Fields/VisualUniqueSelection/ImageSelection";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { parseTheme } from "@
|
|
4
|
+
import { parseTheme } from "@ax/helpers";
|
|
5
5
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
6
|
import "@testing-library/jest-dom";
|
|
7
7
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
@@ -3,7 +3,7 @@ import ScrollableSelection, {
|
|
|
3
3
|
IScrollableSelectionProps,
|
|
4
4
|
} from "@ax/components/Fields/VisualUniqueSelection/ScrollableSelection";
|
|
5
5
|
import { ThemeProvider } from "styled-components";
|
|
6
|
-
import { parseTheme } from "@
|
|
6
|
+
import { parseTheme } from "@ax/helpers";
|
|
7
7
|
import globalTheme from "@ax/themes/theme.json";
|
|
8
8
|
import "@testing-library/jest-dom";
|
|
9
9
|
import { render, screen, cleanup, fireEvent } from "@testing-library/react";
|
|
@@ -131,8 +131,8 @@ describe("ScrollableSelection component events", () => {
|
|
|
131
131
|
const dots = screen.getAllByTestId("dotSelected");
|
|
132
132
|
expect((dots[0] as HTMLOptionElement).selected).toBeTruthy();
|
|
133
133
|
expect(screen.getByTestId("scrollableSelectionComponent")).toBeTruthy();
|
|
134
|
-
const nextButton = screen.getAllByTestId("
|
|
135
|
-
const prevButton = screen.getAllByTestId("
|
|
134
|
+
const nextButton = screen.getAllByTestId("icon-action-component")[1];
|
|
135
|
+
const prevButton = screen.getAllByTestId("icon-action-component")[0];
|
|
136
136
|
fireEvent.click(nextButton);
|
|
137
137
|
expect((dots[0] as HTMLOptionElement).selected).toBeFalsy();
|
|
138
138
|
expect((dots[1] as HTMLOptionElement).selected).toBeTruthy();
|
package/src/__tests__/components/Fields/VisualUniqueSelection/VisualUniqueSelection.test.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import VisualUniqueSelection from "@ax/components/Fields/VisualUniqueSelection";
|
|
|
3
3
|
import { IImageSelectionProps } from "@ax/components/Fields/VisualUniqueSelection/ImageSelection";
|
|
4
4
|
import { IScrollableSelectionProps } from "@ax/components/Fields/VisualUniqueSelection/ScrollableSelection";
|
|
5
5
|
import { ThemeProvider } from "styled-components";
|
|
6
|
-
import { parseTheme } from "@
|
|
6
|
+
import { parseTheme } from "@ax/helpers";
|
|
7
7
|
import globalTheme from "@ax/themes/theme.json";
|
|
8
8
|
import { render, screen, cleanup } from "@testing-library/react";
|
|
9
9
|
import { mock } from "jest-mock-extended";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ThemeProvider } from "styled-components";
|
|
3
|
-
import { parseTheme } from "@
|
|
3
|
+
import { parseTheme } from "@ax/helpers";
|
|
4
4
|
import { mock } from "jest-mock-extended";
|
|
5
5
|
import configureStore from "redux-mock-store";
|
|
6
6
|
|