From fc6c2e2064b3f7312f00ff2d10096c4e715c5b62 Mon Sep 17 00:00:00 2001 From: Druvis Cukurs Date: Thu, 16 Jul 2020 18:51:46 +0300 Subject: [PATCH] [Flex]: add justifyEvenly; [package.json]: add React as devDependency (husky pre-commit error); --- __tests__/container.js | 8 ++++++++ package.json | 3 ++- src/flex.js | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/__tests__/container.js b/__tests__/container.js index 1aa5f44..29979ac 100644 --- a/__tests__/container.js +++ b/__tests__/container.js @@ -117,6 +117,14 @@ test('it works - justifyAround', () => { expect(tree).toHaveStyleRule('justify-content', 'space-around'); }); +test('it works - justifyEvenly', () => { + const tree = renderer + .create(React.createElement(Flex, { justifyEvenly: true })) + .toJSON(); + expect(tree).toMatchSnapshot(); + expect(tree).toHaveStyleRule('justify-content', 'space-evenly'); +}); + test('it works - contentStart', () => { const tree = renderer .create(React.createElement(Flex, { contentStart: true })) diff --git a/package.json b/package.json index e387d87..dfa1938 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,8 @@ "jest-styled-components": "^7.0.2", "lint-staged": "^10.2.11", "prettier": "^2.0.5", - "react-test-renderer": "^16.13.1" + "react-test-renderer": "^16.13.1", + "react": "^16.13.1" }, "lint-staged": { "**.{js,md}": [ diff --git a/src/flex.js b/src/flex.js index 19b7299..647254a 100644 --- a/src/flex.js +++ b/src/flex.js @@ -75,6 +75,10 @@ export default styled.div.withConfig({ justify-content: space-around; `}; + ${is('justifyEvenly')` + justify-content: space-evenly; + `}; + /****************************** align-content ******************************/ /************** http://cssreference.io/property/align-content **************/