From c5ca9ab5a39649d3f838554b403f041d4df5a05b Mon Sep 17 00:00:00 2001 From: Dor Shaked Date: Wed, 7 Oct 2020 11:30:28 +0300 Subject: [PATCH 1/2] feat: bump version * bump version * update README.md for release flow --- .../FormattedNumber/FormattedNumber-test.js | 34 +++++++-------- .../FormattedNumber/FormattedNumber.jsx | 3 +- .../__stories__/formattedNumber.stories.js | 42 +++++++++---------- .../LinearProgressBar/Bar/Bar.jsx | 5 +-- .../LinearProgressBar-test.js | 6 +-- .../__stories__/linearProgressBar.stories.js | 2 +- 6 files changed, 45 insertions(+), 47 deletions(-) diff --git a/src/components/FormattedNumber/FormattedNumber-test.js b/src/components/FormattedNumber/FormattedNumber-test.js index 95805476e0..c8c7e8da77 100644 --- a/src/components/FormattedNumber/FormattedNumber-test.js +++ b/src/components/FormattedNumber/FormattedNumber-test.js @@ -1,7 +1,7 @@ import React from "react"; +import { render, cleanup } from "@testing-library/react"; import { expect } from "../../test/test-helpers"; import FormattedNumber from "./FormattedNumber"; -import { render, cleanup } from "@testing-library/react"; describe("FormattedNumber Tests", () => { beforeEach(() => cleanup()); @@ -9,26 +9,24 @@ describe("FormattedNumber Tests", () => { describe("emptyPlaceHolder", () => { it("no props where provided", () => { - const { getByText } = render(); + const { getByText } = render(); expect(getByText("N/A")).to.be.ok; }); it("invalid value - empty string", () => { - const { getByText } = render(); + const { getByText } = render(); expect(getByText("N/A")).to.be.ok; }); it("invalid value - mixed content", () => { - const { getByText } = render( - - ); + const { getByText } = render(); expect(getByText("N/A")).to.be.ok; }); it("invalid value - mixed content", () => { const emptyPlaceHolderText = "Test"; const { getByText } = render( - + ); expect(getByText(emptyPlaceHolderText)).to.be.ok; }); @@ -42,7 +40,7 @@ describe("FormattedNumber Tests", () => { it("should format small number without sign", () => { const expectedText = "98"; const { getByText } = render( - + ); expect(getByText(expectedText)).to.be.ok; }); @@ -50,7 +48,7 @@ describe("FormattedNumber Tests", () => { it("should format large number with sign", () => { const expectedText = "987.6543M"; const { getByText } = render( - + ); expect(getByText(expectedText)).to.be.ok; }); @@ -58,7 +56,7 @@ describe("FormattedNumber Tests", () => { it("should format large number without sign", () => { const expectedText = "987,654,321"; const { getByText } = render( - + ); expect(getByText(expectedText)).to.be.ok; }); @@ -67,7 +65,7 @@ describe("FormattedNumber Tests", () => { const expectedText = "987,654,321.123"; const { getByText } = render( { const expectedText = "987,654,321"; const { getByText } = render( { const expectedText = "987,654,321.123456"; const { getByText } = render( { it("should use handle unsupported local", () => { const badLocal = "bad"; const { container, getByText } = render( - + ); expect(container).is.ok; expect(getByText("456")).to.be.ok; @@ -122,9 +120,9 @@ describe("FormattedNumber Tests", () => { const suffix = "suf"; it("should render predix and suffix in the correct order if provided", () => { - const { getByText, container } = render( + const { container } = render( { }); it("should render rtl", () => { - const { getByText, container } = render( + const { container } = render( ( -
-
- -
+
+
+
+
); export default { - title: "Components/FormattedNumber", - component: FormattedNumber + title: "Components/FormattedNumber", + component: FormattedNumber }; diff --git a/src/components/ProgressBars/LinearProgressBar/Bar/Bar.jsx b/src/components/ProgressBars/LinearProgressBar/Bar/Bar.jsx index d8cab21fd0..c7aa998ffe 100644 --- a/src/components/ProgressBars/LinearProgressBar/Bar/Bar.jsx +++ b/src/components/ProgressBars/LinearProgressBar/Bar/Bar.jsx @@ -4,11 +4,10 @@ import { calculatePercentage } from "../LinearProgressBarHelpers"; const Bar = ({ value, baseClass, barStyle, animated, min, max, color }) => { const classNames = useMemo(() => { - const classNames = cx(baseClass, `${baseClass}--${barStyle}`, { + return cx(baseClass, `${baseClass}--${barStyle}`, { [`${baseClass}--animate`]: animated }); - return classNames; - }, [barStyle, animated, animated]); + }, [barStyle, animated, baseClass]); const valuePercentage = useMemo(() => { if (value === null || value === undefined) return 0; diff --git a/src/components/ProgressBars/LinearProgressBar/LinearProgressBar-test.js b/src/components/ProgressBars/LinearProgressBar/LinearProgressBar-test.js index eb0773ea5d..2456205fbc 100644 --- a/src/components/ProgressBars/LinearProgressBar/LinearProgressBar-test.js +++ b/src/components/ProgressBars/LinearProgressBar/LinearProgressBar-test.js @@ -1,7 +1,7 @@ import React from "react"; -import { expect, sinon } from "../../../test/test-helpers"; -import LinearProgressBar from "./LinearProgressBar"; import { render, cleanup, act, screen } from "@testing-library/react"; +import { expect } from "../../../test/test-helpers"; +import LinearProgressBar from "./LinearProgressBar"; describe("ProgressBars Tests", () => { let component; @@ -76,7 +76,7 @@ describe("ProgressBars Tests", () => { const value = 13; for (let i = 0; i < 2; i++) { act(() => { - component = rerender( + rerender( ( From ed24b9713ad63d910eca32616bb6b16af42cad18 Mon Sep 17 00:00:00 2001 From: Dor Shaked Date: Wed, 7 Oct 2020 11:33:42 +0300 Subject: [PATCH 2/2] feat: bump version * bump version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c605290574..8a5e9b654c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "monday-ui-react-core", - "version": "0.0.3", + "version": "0.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 246f478f88..f93fc94f26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monday-ui-react-core", - "version": "0.0.3", + "version": "0.0.4", "description": "Official monday.com UI resources for application development in React.js", "main": "dist/main.js", "scripts": {