@plurix/ecom-components 0.0.2-beta.9 → 1.0.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/README.md +76 -48
- package/dist/assets/svgs/ArrowIcon.d.ts +1 -1
- package/dist/assets/svgs/ArrowIcon.js +3 -2
- package/dist/assets/svgs/ErrorIcon.d.ts +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +4 -2
- package/dist/packages/Modal/Modal.d.ts +14 -0
- package/dist/packages/Modal/Modal.js +53 -0
- package/dist/packages/Onboarding/constants/tips.js +9 -9
- package/dist/packages/Onboarding/tips/Tip2.js +225 -236
- package/dist/packages/Onboarding/tips/Tip3.js +236 -225
- package/dist/packages/Regionalization/utils/localStorage.js +1 -1
- package/dist/styles/modal.global.css +1 -0
- package/package.json +72 -58
- package/dist/packages/Carousel/test/Carrousel.test.js +0 -80
- package/dist/packages/Coupons/test/Alert.test.js +0 -18
- package/dist/packages/Coupons/test/Breadcrumb.test.js +0 -41
- package/dist/packages/Coupons/test/ModalFooter.test.js +0 -32
- package/dist/packages/Coupons/test/ModalHeader.test.js +0 -23
- package/dist/packages/Coupons/test/NoCoupons.test.js +0 -17
- package/dist/packages/Onboarding/test/Bullets.test.js +0 -20
- package/dist/packages/Onboarding/test/Content.test.js +0 -52
- package/dist/packages/Onboarding/test/Footer.test.js +0 -60
- package/dist/packages/Onboarding/test/Header.test.js +0 -30
- package/dist/packages/Onboarding/test/Onboarding.test.js +0 -22
- package/dist/packages/Onboarding/test/SocialMedia.test.js +0 -39
- package/dist/packages/Tour/test/TooltipFooter.test.js +0 -68
- package/dist/packages/Tour/test/TooltipHeader.test.js +0 -18
- package/dist/packages/Tour/test/Tour.test.js +0 -45
- package/dist/packages/Tour/test/TourOverlay.test.js +0 -18
- package/dist/packages/Tour/test/TourTooltip.test.js +0 -40
- /package/dist/{packages/Regionalization/utils/constants.d.ts → constants/index.d.ts} +0 -0
- /package/dist/{packages/Regionalization/utils/constants.js → constants/index.js} +0 -0
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { render as n, fireEvent as c } from "@testing-library/react";
|
|
3
|
-
import "@testing-library/jest-dom";
|
|
4
|
-
import { TooltipFooter as r } from "../components/TooltipFooter.js";
|
|
5
|
-
describe("TooltipFooter", () => {
|
|
6
|
-
const t = jest.fn(), s = jest.fn(), o = jest.fn();
|
|
7
|
-
it("should render the previous close button when it is the first step", () => {
|
|
8
|
-
const { getByText: e } = n(
|
|
9
|
-
/* @__PURE__ */ i(
|
|
10
|
-
r,
|
|
11
|
-
{
|
|
12
|
-
stepNumber: 1,
|
|
13
|
-
isFirstStep: !0,
|
|
14
|
-
isLastStep: !1,
|
|
15
|
-
onClose: t,
|
|
16
|
-
onPrevious: s,
|
|
17
|
-
onNext: o
|
|
18
|
-
}
|
|
19
|
-
)
|
|
20
|
-
);
|
|
21
|
-
expect(e("Fechar Explicação")).toBeInTheDocument();
|
|
22
|
-
}), it("should call onClose with specific text when previous close button is clicked", () => {
|
|
23
|
-
const { getByText: e } = n(
|
|
24
|
-
/* @__PURE__ */ i(
|
|
25
|
-
r,
|
|
26
|
-
{
|
|
27
|
-
stepNumber: 1,
|
|
28
|
-
isFirstStep: !0,
|
|
29
|
-
isLastStep: !1,
|
|
30
|
-
onClose: t,
|
|
31
|
-
onPrevious: s,
|
|
32
|
-
onNext: o
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
);
|
|
36
|
-
c.click(e("Fechar Explicação")), expect(t).toHaveBeenCalledWith("Fechar Explicação");
|
|
37
|
-
}), it("should render the next button when it is not the last step", () => {
|
|
38
|
-
const { getByText: e } = n(
|
|
39
|
-
/* @__PURE__ */ i(
|
|
40
|
-
r,
|
|
41
|
-
{
|
|
42
|
-
stepNumber: 2,
|
|
43
|
-
isFirstStep: !1,
|
|
44
|
-
isLastStep: !1,
|
|
45
|
-
onClose: t,
|
|
46
|
-
onPrevious: s,
|
|
47
|
-
onNext: o
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
);
|
|
51
|
-
expect(e("Próximo >")).toBeInTheDocument();
|
|
52
|
-
}), it("should call onNext when next button is clicked", () => {
|
|
53
|
-
const { getByText: e } = n(
|
|
54
|
-
/* @__PURE__ */ i(
|
|
55
|
-
r,
|
|
56
|
-
{
|
|
57
|
-
stepNumber: 2,
|
|
58
|
-
isFirstStep: !1,
|
|
59
|
-
isLastStep: !1,
|
|
60
|
-
onClose: t,
|
|
61
|
-
onPrevious: s,
|
|
62
|
-
onNext: o
|
|
63
|
-
}
|
|
64
|
-
)
|
|
65
|
-
);
|
|
66
|
-
c.click(e("Próximo >")), expect(o).toHaveBeenCalled();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { render as r, fireEvent as l } from "@testing-library/react";
|
|
3
|
-
import "@testing-library/jest-dom";
|
|
4
|
-
import { TooltipHeader as s } from "../components/TooltipHeader.js";
|
|
5
|
-
describe("TooltipHeader", () => {
|
|
6
|
-
const e = jest.fn();
|
|
7
|
-
it("should render the step number and total steps correctly", () => {
|
|
8
|
-
const { getByText: t } = r(
|
|
9
|
-
/* @__PURE__ */ o(s, { stepNumber: 2, totalSteps: 5, onClose: e })
|
|
10
|
-
);
|
|
11
|
-
expect(t("2 de 5")).toBeInTheDocument();
|
|
12
|
-
}), it("should call onClose when close button is clicked", () => {
|
|
13
|
-
const { getByRole: t } = r(
|
|
14
|
-
/* @__PURE__ */ o(s, { stepNumber: 2, totalSteps: 5, onClose: e })
|
|
15
|
-
);
|
|
16
|
-
l.click(t("button")), expect(e).toHaveBeenCalledWith("Botão Fechar");
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import l from "react";
|
|
3
|
-
import { render as i, fireEvent as a } from "@testing-library/react";
|
|
4
|
-
import "@testing-library/jest-dom";
|
|
5
|
-
import { Tour as s } from "../Tour.js";
|
|
6
|
-
jest.mock("../components/TourTooltip", () => ({ TourTooltip: l.forwardRef(
|
|
7
|
-
(e, o) => /* @__PURE__ */ r("div", { ref: o, "data-testid": "tour-tooltip" })
|
|
8
|
-
) }));
|
|
9
|
-
jest.mock("../components/TourOverlay", () => ({
|
|
10
|
-
TourOverlay: ({ onClick: t }) => /* @__PURE__ */ r("div", { onClick: t, "data-testid": "tour-overlay" })
|
|
11
|
-
}));
|
|
12
|
-
describe("Tour", () => {
|
|
13
|
-
const t = [
|
|
14
|
-
{ selector: ".step-1", content: "Step 1 Content" },
|
|
15
|
-
{ selector: ".step-2", content: "Step 2 Content" },
|
|
16
|
-
{ selector: ".step-3", content: "Step 3 Content" }
|
|
17
|
-
], e = jest.fn(), o = jest.fn(), c = jest.fn();
|
|
18
|
-
it("should render correctly with initial step", () => {
|
|
19
|
-
const { getByTestId: n } = i(
|
|
20
|
-
/* @__PURE__ */ r(
|
|
21
|
-
s,
|
|
22
|
-
{
|
|
23
|
-
steps: t,
|
|
24
|
-
handleCloseAction: e,
|
|
25
|
-
handleFinishAction: o,
|
|
26
|
-
genericTaggingEvent: c
|
|
27
|
-
}
|
|
28
|
-
)
|
|
29
|
-
);
|
|
30
|
-
expect(n("tour-tooltip")).toBeInTheDocument(), expect(n("tour-overlay")).toBeInTheDocument();
|
|
31
|
-
}), it("should call handleCloseAction when TourOverlay is clicked", () => {
|
|
32
|
-
const { getByTestId: n } = i(
|
|
33
|
-
/* @__PURE__ */ r(
|
|
34
|
-
s,
|
|
35
|
-
{
|
|
36
|
-
steps: t,
|
|
37
|
-
handleCloseAction: e,
|
|
38
|
-
handleFinishAction: o,
|
|
39
|
-
genericTaggingEvent: c
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
);
|
|
43
|
-
a.click(n("tour-overlay")), expect(e).toHaveBeenCalled();
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { render as r, fireEvent as c } from "@testing-library/react";
|
|
3
|
-
import "@testing-library/jest-dom";
|
|
4
|
-
import { TourOverlay as l } from "../components/TourOverlay.js";
|
|
5
|
-
describe("TourOverlay", () => {
|
|
6
|
-
const e = jest.fn();
|
|
7
|
-
it("should render the tour overlay", () => {
|
|
8
|
-
const { getByTestId: o } = r(
|
|
9
|
-
/* @__PURE__ */ t(l, { stepNumber: 1, onClick: e })
|
|
10
|
-
);
|
|
11
|
-
expect(o("tour-overlay")).toBeInTheDocument();
|
|
12
|
-
}), it("should call onClick when the overlay is clicked", () => {
|
|
13
|
-
const { getByTestId: o } = r(
|
|
14
|
-
/* @__PURE__ */ t(l, { stepNumber: 1, onClick: e })
|
|
15
|
-
);
|
|
16
|
-
c.click(o("tour-overlay")), expect(e).toHaveBeenCalledWith("Clique no overlay");
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { render as r } from "@testing-library/react";
|
|
3
|
-
import "@testing-library/jest-dom";
|
|
4
|
-
import { TourTooltip as c } from "../components/TourTooltip.js";
|
|
5
|
-
describe("TourTooltip", () => {
|
|
6
|
-
const t = jest.fn(), e = jest.fn(), n = jest.fn(), s = { content: "Step Content" };
|
|
7
|
-
it("should render correctly with provided props", () => {
|
|
8
|
-
const { getByText: o } = r(
|
|
9
|
-
/* @__PURE__ */ p(
|
|
10
|
-
c,
|
|
11
|
-
{
|
|
12
|
-
step: s,
|
|
13
|
-
position: { top: 100 },
|
|
14
|
-
onClose: t,
|
|
15
|
-
onPrevious: e,
|
|
16
|
-
onNext: n,
|
|
17
|
-
totalSteps: 3,
|
|
18
|
-
stepNumber: 2
|
|
19
|
-
}
|
|
20
|
-
)
|
|
21
|
-
);
|
|
22
|
-
expect(o("Step Content")).toBeInTheDocument(), expect(o("2 de 3")).toBeInTheDocument();
|
|
23
|
-
}), it("should have correct style for position", () => {
|
|
24
|
-
const { getByTestId: o } = r(
|
|
25
|
-
/* @__PURE__ */ p(
|
|
26
|
-
c,
|
|
27
|
-
{
|
|
28
|
-
step: s,
|
|
29
|
-
position: { top: 100 },
|
|
30
|
-
onClose: t,
|
|
31
|
-
onPrevious: e,
|
|
32
|
-
onNext: n,
|
|
33
|
-
totalSteps: 3,
|
|
34
|
-
stepNumber: 2
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
), i = o("tour-tooltip");
|
|
38
|
-
expect(i.style.top).toBe("100px");
|
|
39
|
-
});
|
|
40
|
-
});
|
|
File without changes
|
|
File without changes
|