From 676ed31a3717a0a89232b710e939600041dfd132 Mon Sep 17 00:00:00 2001 From: Dishebh Bhayana Date: Wed, 13 May 2020 23:56:18 +0530 Subject: [PATCH 01/26] added ignitus-ScrollBar component --- .../ignitus-UserInterfaceBookRoutes/index.tsx | 2 + .../ignitus-ScrollBar/Components/index.tsx | 12 ++++++ .../ignitus-ScrollBar/styles.ts | 39 +++++++++++++++++++ src/ignitus-Shared/index.ts | 4 ++ .../interfaceScrollBar/Components/index.tsx | 11 ++++++ .../InterfaceSideNavigation/constants.ts | 4 ++ 6 files changed, 72 insertions(+) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/index.tsx create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts create mode 100644 src/ignitus-UserInterfaceBook/Components/Molecules/interfaceScrollBar/Components/index.tsx diff --git a/src/ignitus-Routes/ignitus-UserInterfaceBookRoutes/index.tsx b/src/ignitus-Routes/ignitus-UserInterfaceBookRoutes/index.tsx index 219f62fa..5cc1d310 100644 --- a/src/ignitus-Routes/ignitus-UserInterfaceBookRoutes/index.tsx +++ b/src/ignitus-Routes/ignitus-UserInterfaceBookRoutes/index.tsx @@ -30,6 +30,7 @@ import { InterfaceAvatar } from '../../ignitus-UserInterfaceBook/Components/Orga import { interfaceSideProfile } from '../../ignitus-UserInterfaceBook/Components/Organisms/interfaceSideProfile/Components/index'; import { InterfaceProgress } from '../../ignitus-UserInterfaceBook/Components/Molecules/interfaceProgress/index'; import { interfaceSecondaryDropDown } from '../../ignitus-UserInterfaceBook/Components/Atoms/interfaceSecondaryDropdown/Components'; +import { interfaceScrollBar } from '../../ignitus-UserInterfaceBook/Components/Molecules/interfaceScrollBar/Components'; const Container = styled.div` display: flex; @@ -127,6 +128,7 @@ export const UserInterfaceBookRoutes: React.FunctionComponent = () => ( + diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/index.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/index.tsx new file mode 100644 index 00000000..a4e25cf7 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/index.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import * as S from '../styles'; + +const ScrollBar = () => ( + + + + + +); + +export default ScrollBar; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts new file mode 100644 index 00000000..efa72fca --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts @@ -0,0 +1,39 @@ +import styled from '@emotion/styled'; + +export const Scroll = styled.div` + margin: 30px; + float: left; + height: 300px; + width: 65px; + background: #f5f5f5; + overflow-y: scroll; + margin-bottom: 25px; + + ::-webkit-scrollbar { + width: 10px; + background: #f5f5f5; + } + + ::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); + background: #f5f5f5; + } + + ::-webkit-scrollbar-thumb { + background-color: #f90; + background-image: -webkit-linear-gradient( + 90deg, + rgba(255, 255, 255, 0.2) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.2) 50%, + rgba(255, 255, 255, 0.2) 75%, + transparent 75%, + transparent + ); + } +`; + +export const Overflow = styled.div` + min-height: 450px; +`; diff --git a/src/ignitus-Shared/index.ts b/src/ignitus-Shared/index.ts index 554349b6..e7293398 100644 --- a/src/ignitus-Shared/index.ts +++ b/src/ignitus-Shared/index.ts @@ -72,6 +72,10 @@ export { default as Overlay, } from './ignitus-DesignSystem/ignitus-Molecules/ignitus-Overlay/Components'; +export { + default as ScrollBar, +} from './ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components'; + /** * ignitus-Organisms */ diff --git a/src/ignitus-UserInterfaceBook/Components/Molecules/interfaceScrollBar/Components/index.tsx b/src/ignitus-UserInterfaceBook/Components/Molecules/interfaceScrollBar/Components/index.tsx new file mode 100644 index 00000000..74d8c767 --- /dev/null +++ b/src/ignitus-UserInterfaceBook/Components/Molecules/interfaceScrollBar/Components/index.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { Heading2, ScrollBar } from '../../../../../ignitus-Shared'; +import { Interface } from '../../../../styles'; + +export const interfaceScrollBar = () => ( + + Scroll Bar +
+ +
+); diff --git a/src/ignitus-UserInterfaceBook/InterfaceSideNavigation/constants.ts b/src/ignitus-UserInterfaceBook/InterfaceSideNavigation/constants.ts index 64570952..d61e1b06 100644 --- a/src/ignitus-UserInterfaceBook/InterfaceSideNavigation/constants.ts +++ b/src/ignitus-UserInterfaceBook/InterfaceSideNavigation/constants.ts @@ -117,6 +117,10 @@ export const allEdges: Edges[] = [ title: 'Overlay', route: '/interface/overlay', }, + { + title: 'Scroll Bar', + route: '/interface/scrollBar', + }, ], }, { From 67422d55b24ee5c2ed69e9a89c0fbab4a8a47b01 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Fri, 15 May 2020 20:16:10 +0530 Subject: [PATCH 02/26] added tests for ignitus-ToggleButtons --- .../Components/ToggleButtoninterface.test.tsx | 50 +++ .../ToggleButtoninterface.test.tsx.snap | 154 ++++++++ .../__snapshots__/index.test.tsx.snap | 352 ++++++++++++++++++ .../Components/index.test.tsx | 90 +++++ 4 files changed, 646 insertions(+) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/__snapshots__/ToggleButtoninterface.test.tsx.snap create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/__snapshots__/index.test.tsx.snap create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/index.test.tsx diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx new file mode 100644 index 00000000..3fbddcc8 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx @@ -0,0 +1,50 @@ +import React from 'react'; +import { mount, render } from 'enzyme'; +import emotionSerializer, { matchers } from 'jest-emotion'; + +import { ToggleButtonInterface } from './ToggleButtoninterface'; +import { ToggleButtonInterfaceProps } from '../types'; +import { ButtonLeft, ButtonRight } from '../styles'; + +const props: ToggleButtonInterfaceProps = { + activeCategory: 'primary', + inActiveCategory: 'grey', + children: { + leftButtonContent: <> Left , + rightButtonContent: <> Right , + }, +}; + +let wrapper; + +expect.addSnapshotSerializer(emotionSerializer); +expect.extend(matchers); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render buttons with correct categories', () => { + expect(wrapper.find(ButtonLeft).prop('category')).toBe( + props.activeCategory, + ); + expect(wrapper.find(ButtonRight).prop('category')).toBe( + props.inActiveCategory, + ); + }); + + it('should render buttons with correct content', () => { + expect(wrapper.find(ButtonLeft).prop('children')).toBe( + props.children.leftButtonContent, + ); + expect(wrapper.find(ButtonRight).prop('children')).toBe( + props.children.rightButtonContent, + ); + }); +}); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/__snapshots__/ToggleButtoninterface.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/__snapshots__/ToggleButtoninterface.test.tsx.snap new file mode 100644 index 00000000..0c17db9a --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/__snapshots__/ToggleButtoninterface.test.tsx.snap @@ -0,0 +1,154 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +.emotion-2 { + cursor: pointer; +} + +.emotion-0 { + border-radius: 5px; + border: none; + cursor: pointer; + outline: none; + padding: 16px 32px; + text-align: center; + line-height: 1rem; + margin: 0.5rem; + outline: none; + font-size: 18px; + font-weight: 400; + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; + outline: none; + color: #ffffff; + background-color: #000066; + padding: 8px 20px; + font-size: 16px; + border-radius: 3px; + border: none; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + font-weight: 600; + margin: 0; + border: 0; + float: left; + border-radius: 20px 0 0 20px; +} + +.emotion-0:hover, +.emotion-0:focus { + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); +} + +.emotion-0 a { + color: #ffffff; +} + +.emotion-0:hover, +.emotion-0:focus { + background-color: #F9BF64; + color: #000066; + outline: none; +} + +.emotion-0:hover a, +.emotion-0:focus a { + color: #000066; +} + +.emotion-0:hover svg, +.emotion-0:focus svg { + fill: #000066; +} + +.emotion-1 { + border-radius: 5px; + border: none; + cursor: pointer; + outline: none; + padding: 16px 32px; + text-align: center; + line-height: 1rem; + margin: 0.5rem; + outline: none; + font-size: 18px; + font-weight: 400; + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; + outline: none; + color: #000066; + background-color: #E0E0E0; + padding: 8px 20px; + font-size: 16px; + border-radius: 3px; + border: none; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + font-weight: 600; + margin: 0; + border: 0; + float: left; + border-radius: 0 20px 20px 0; +} + +.emotion-1:hover, +.emotion-1:focus { + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); +} + +.emotion-1 a { + color: #000066; +} + +.emotion-1:hover, +.emotion-1:focus { + background-color: #C4C4C4; + color: #000066; + outline: none; +} + +.emotion-1:hover a, +.emotion-1:focus a { + color: #000066; +} + +.emotion-1:hover svg, +.emotion-1:focus svg { + fill: #000066; +} + + + + + +`; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/__snapshots__/index.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/__snapshots__/index.test.tsx.snap new file mode 100644 index 00000000..0d932de3 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/__snapshots__/index.test.tsx.snap @@ -0,0 +1,352 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +.emotion-2 { + cursor: pointer; +} + +.emotion-0 { + border-radius: 5px; + border: none; + cursor: pointer; + outline: none; + padding: 16px 32px; + text-align: center; + line-height: 1rem; + margin: 0.5rem; + outline: none; + font-size: 18px; + font-weight: 400; + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; + outline: none; + color: #ffffff; + background-color: #000066; + padding: 8px 20px; + font-size: 16px; + border-radius: 3px; + border: none; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + font-weight: 600; + margin: 0; + border: 0; + float: left; + border-radius: 20px 0 0 20px; +} + +.emotion-0:hover, +.emotion-0:focus { + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); +} + +.emotion-0 a { + color: #ffffff; +} + +.emotion-0:hover, +.emotion-0:focus { + background-color: #F9BF64; + color: #000066; + outline: none; +} + +.emotion-0:hover a, +.emotion-0:focus a { + color: #000066; +} + +.emotion-0:hover svg, +.emotion-0:focus svg { + fill: #000066; +} + +.emotion-1 { + border-radius: 5px; + border: none; + cursor: pointer; + outline: none; + padding: 16px 32px; + text-align: center; + line-height: 1rem; + margin: 0.5rem; + outline: none; + font-size: 18px; + font-weight: 400; + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; + outline: none; + color: #000066; + background-color: #E0E0E0; + padding: 8px 20px; + font-size: 16px; + border-radius: 3px; + border: none; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + font-weight: 600; + margin: 0; + border: 0; + float: left; + border-radius: 0 20px 20px 0; +} + +.emotion-1:hover, +.emotion-1:focus { + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); +} + +.emotion-1 a { + color: #000066; +} + +.emotion-1:hover, +.emotion-1:focus { + background-color: #C4C4C4; + color: #000066; + outline: none; +} + +.emotion-1:hover a, +.emotion-1:focus a { + color: #000066; +} + +.emotion-1:hover svg, +.emotion-1:focus svg { + fill: #000066; +} + + + + + +`; + +exports[` should render 1`] = ` +.emotion-4 { + cursor: pointer; +} + +.emotion-1 { + border-radius: 5px; + border: none; + cursor: pointer; + outline: none; + padding: 16px 32px; + text-align: center; + line-height: 1rem; + margin: 0.5rem; + outline: none; + font-size: 18px; + font-weight: 400; + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; + outline: none; + color: #000066; + background-color: #E0E0E0; + padding: 8px 20px; + font-size: 16px; + border-radius: 3px; + border: none; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + font-weight: 600; + margin: 0; + border: 0; + float: left; + border-radius: 20px 0 0 20px; +} + +.emotion-1:hover, +.emotion-1:focus { + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); +} + +.emotion-1 a { + color: #000066; +} + +.emotion-1:hover, +.emotion-1:focus { + background-color: #C4C4C4; + color: #000066; + outline: none; +} + +.emotion-1:hover a, +.emotion-1:focus a { + color: #000066; +} + +.emotion-1:hover svg, +.emotion-1:focus svg { + fill: #000066; +} + +.emotion-0 { + width: 1.4rem; + fill: #000066; + -webkit-transition: 0.3s; + transition: 0.3s; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + margin: 0.03rem; +} + +.emotion-3 { + border-radius: 5px; + border: none; + cursor: pointer; + outline: none; + padding: 16px 32px; + text-align: center; + line-height: 1rem; + margin: 0.5rem; + outline: none; + font-size: 18px; + font-weight: 400; + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; + outline: none; + color: #000066; + background-color: #ffffff; + padding: 8px 20px; + font-size: 16px; + border-radius: 3px; + border: none; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + font-weight: 600; + margin: 0; + border: 0; + float: left; + border-radius: 0 20px 20px 0; +} + +.emotion-3:hover, +.emotion-3:focus { + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); +} + +.emotion-3 a { + color: #000066; +} + +.emotion-3:hover, +.emotion-3:focus { + background-color: none; + color: none; + outline: none; +} + +.emotion-3:hover a, +.emotion-3:focus a { + color: #000066; +} + +.emotion-3:hover svg, +.emotion-3:focus svg { + fill: #000066; +} + + + + + +`; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/index.test.tsx new file mode 100644 index 00000000..fab35572 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/index.test.tsx @@ -0,0 +1,90 @@ +import React from 'react'; +import { mount, render } from 'enzyme'; +import emotionSerializer, { matchers } from 'jest-emotion'; + +import { ToggleButton, ToggleIconButton } from './index'; +import { ToggleButtonProps, ToggleIconButtonProps } from '../types'; +import { AppIcon } from '../../../../types/iconsTypes/iconEnums'; +import { StyledIcon } from '../styles'; +import { IgnitusBlue } from '../../../..'; + +const propsButton: ToggleButtonProps = { + leftLabel: 'left', + rightLabel: 'right', +}; + +const propsButtonIcon: ToggleIconButtonProps = { + leftIcon: AppIcon.GridIcon, + rightIcon: AppIcon.BarsIcon, +}; + +const propsStyledIcon = { + name: AppIcon.GridIcon, + color: `${IgnitusBlue}`, +}; + +const colorCheck = () => { + const Icon = mount(); + expect(Icon).toHaveStyleRule('fill', propsStyledIcon.color); +}; + +let wrapper; + +expect.addSnapshotSerializer(emotionSerializer); +expect.extend(matchers); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render ToggleButton with correct labels', () => { + expect( + wrapper + .find('button') + .at(0) + .text() + .trim(), + ).toBe(propsButton.leftLabel); + expect( + wrapper + .find('button') + .at(1) + .text() + .trim(), + ).toBe(propsButton.rightLabel); + }); +}); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render ToggleButtonIcon with correct icons', () => { + expect( + wrapper + .find(StyledIcon) + .at(0) + .prop('name'), + ).toBe(propsButtonIcon.leftIcon); + expect( + wrapper + .find(StyledIcon) + .at(1) + .prop('name'), + ).toBe(propsButtonIcon.rightIcon); + }); + + it('should render StyledIcon with color passed in prop', colorCheck); +}); From 44ce684eec53a4aa34304d9fe4a59429a5149863 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Sat, 16 May 2020 16:00:47 +0530 Subject: [PATCH 03/26] added test for ignitus-SideProfile --- .../__snapshots__/index.test.tsx.snap | 237 ++++++++++++++++++ .../Components/index.test.tsx | 43 ++++ 2 files changed, 280 insertions(+) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-SideProfileCard/Components/__snapshots__/index.test.tsx.snap create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-SideProfileCard/Components/index.test.tsx diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-SideProfileCard/Components/__snapshots__/index.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-SideProfileCard/Components/__snapshots__/index.test.tsx.snap new file mode 100644 index 00000000..7f25f407 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-SideProfileCard/Components/__snapshots__/index.test.tsx.snap @@ -0,0 +1,237 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +.emotion-11 { + background-color: #ffffff; + border-radius: 1rem; + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); + color: #000066; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + height: 12rem; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + padding: 1.5rem; + width: 17rem; +} + +.emotion-7 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + margin-bottom: 2rem; +} + +.emotion-0 { + border-radius: 1rem; + height: 6rem; +} + +.emotion-6 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + text-align: center; +} + +.emotion-3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-pack: start; + -webkit-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + line-height: 1.7rem; +} + +.emotion-1 { + font-weight: 500; + font-size: 22px; + color: #000066; +} + +.emotion-2 { + font-weight: 500; + font-size: 16px; + color: #000066; +} + +.emotion-4 { + border-radius: 5px; + border: none; + cursor: pointer; + outline: none; + padding: 16px 32px; + text-align: center; + line-height: 1rem; + margin: 0.5rem; + outline: none; + font-size: 18px; + font-weight: 400; + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; + outline: none; + color: #ffffff; + background-color: #000066; + padding: 8px 20px; + font-size: 16px; + border-radius: 3px; + border: none; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.emotion-4:hover, +.emotion-4:focus { + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); +} + +.emotion-4 a { + color: #ffffff; +} + +.emotion-4:hover, +.emotion-4:focus { + background-color: #F9BF64; + color: #000066; + outline: none; +} + +.emotion-4:hover a, +.emotion-4:focus a { + color: #000066; +} + +.emotion-4:hover svg, +.emotion-4:focus svg { + fill: #000066; +} + +.emotion-10 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; +} + +.emotion-8 { + fill: #000066; + height: 2rem; + margin: 0 1rem 0 0; +} + +.emotion-9 { + font-size: 16px; + font-weight: 400; + color: #2D2D2D; + margin: 0; +} + +
+
+ ProfileImage +
+
+

+ Helen +

+
+ Student +
+
+
+ +
+
+
+
+ + + Bookmark Icon + + + +

+ 10 students are tracking your progree +

+
+
+`; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-SideProfileCard/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-SideProfileCard/Components/index.test.tsx new file mode 100644 index 00000000..a71dead0 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-SideProfileCard/Components/index.test.tsx @@ -0,0 +1,43 @@ +import React from 'react'; +import { mount, render } from 'enzyme'; +import emotionSerializer, { matchers } from 'jest-emotion'; +import { SideProfileCard } from './index'; +import { Props } from '../types'; +import * as S from '../styles'; +import { Button } from '../../../ignitus-Atoms/buttons'; + +const props: Props = { + name: 'Helen', + designation: 'Student', + trackingInformation: '10 students are tracking your progree', +}; + +let wrapper; + +expect.addSnapshotSerializer(emotionSerializer); +expect.extend(matchers); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render name, designation, trackingInformation correctly', () => { + expect(wrapper.find(S.Name).text()).toEqual(props.name); + expect(wrapper.find(S.Designation).text()).toEqual(props.designation); + expect(wrapper.find(S.Text).text()).toEqual(props.trackingInformation); + }); + + it('should render button', () => { + expect(wrapper.find(Button).length).toEqual(1); + }); + + it('should render avatar', () => { + expect(wrapper.find(S.Avatar).length).toEqual(1); + }); +}); From aa24db768a7d788792854759561785eed14dbcb9 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Sat, 16 May 2020 17:11:45 +0530 Subject: [PATCH 04/26] added test for profile card --- .../__snapshots__/index.test.tsx.snap | 484 ++++++++++++++++++ .../Components/index.test.tsx | 49 ++ .../ignitus-ProfileCard/Components/index.tsx | 4 +- 3 files changed, 535 insertions(+), 2 deletions(-) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/__snapshots__/index.test.tsx.snap create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.test.tsx diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/__snapshots__/index.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/__snapshots__/index.test.tsx.snap new file mode 100644 index 00000000..402cd556 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/__snapshots__/index.test.tsx.snap @@ -0,0 +1,484 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +.emotion-35 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + width: 60rem; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + padding: 1rem 2rem; + border-radius: 1rem; + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); + background-color: #ffffff; + color: #000066; +} + +.emotion-2 { + text-align: end; +} + +.emotion-0 { + font-size: 16px; + font-weight: 300; + color: #4D4D4D; + font-weight: 400; + display: inline; + margin: 0 0.5rem 0 0; +} + +.emotion-1 { + width: 1.5rem; + fill: #000066; +} + +.emotion-34 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + padding: 1rem; +} + +.emotion-16 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex: 2; + -ms-flex: 2; + flex: 2; + -webkit-box-pack: start; + -webkit-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; +} + +.emotion-3 { + width: 10rem; + border-radius: 1rem; +} + +.emotion-15 { + margin-left: 4rem; +} + +.emotion-4 { + font-weight: 500; + font-size: 32px; + color: #000066; + font-size: 32px; + font-weight: 600; +} + +.emotion-5 { + font-weight: 400; + font-size: 20px; + color: #000066; + margin-bottom: 1rem; + margin-top: 1rem; +} + +.emotion-8 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + margin: 0.6rem 0; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; +} + +.emotion-7 { + font-size: 16px; + font-weight: 300; + color: #000066; + font-weight: 400; + display: inline; + margin: 0 0 0 0.5rem; +} + +.emotion-14 { + position: relative; + margin-top: 1rem; +} + +.emotion-13 { + font-weight: bold; + color: #9C9C9C; + cursor: pointer; + display: inline-block; + padding-bottom: 10px; + -webkit-transition: all 0.4s; + transition: all 0.4s; + width: -webkit-fit-content; + width: -moz-fit-content; + width: fit-content; +} + +.emotion-13:hover ul { + display: block; +} + +.emotion-12 { + z-index: 3; + position: absolute; + top: 30px; + left: 0; + border-radius: 10px 0 10px 10px; + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); + background-color: #ffffff; + color: #000066; + display: none; + font-weight: 400; +} + +.emotion-12:hover { + display: block; +} + +.emotion-9 { + padding: 0.5em 1em; + font-size: 14px; + width: 200px; +} + +.emotion-9:first-of-type { + border-top-left-radius: 10px; +} + +.emotion-9:last-child { + border-bottom-left-radius: 10px; + border-bottom-right-radius: 10px; +} + +.emotion-9:hover { + color: #ffffff; + background-color: #000066; + cursor: pointer; +} + +.emotion-33 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + -webkit-align-items: flex-start; + -webkit-box-align: flex-start; + -ms-flex-align: flex-start; + align-items: flex-start; +} + +.emotion-25 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + margin-bottom: 2rem; +} + +.emotion-18 { + margin-right: 2rem; + display: inline-block; +} + +.emotion-32 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + width: 100%; +} + +
+
+

+ Track Sophi progress +

+ + + Bookmark Icon + + + +
+
+
+
+ ProfileLogo +
+
+

+ Sophia Carter +

+

+ Literature Student +

+
+ + + Location Icon + + + + +

+ Canada +

+
+
+
+ More ... +
    +
  • + Ask For Recommendation +
  • +
  • + Share Profile +
  • +
  • + Block +
  • +
+
+
+
+
+
+ +
+
+ + + QuestionAnswer Icon + + + + +

+ Send Message +

+
+
+ + + File Icon + + + + +

+ Resume +

+
+
+
+
+
+`; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.test.tsx new file mode 100644 index 00000000..b5d8ade6 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.test.tsx @@ -0,0 +1,49 @@ +import React from 'react'; +import { mount, render } from 'enzyme'; +import emotionSerializer, { matchers } from 'jest-emotion'; +import { UserProfileCard, IconContent, DropDownButton } from './index'; +import * as S from '../styles'; +import { Props } from '../types'; +import { AppIcon } from '../../../../types/iconsTypes/iconEnums'; + +const props: Props = { + content: 'Send Message', + name: AppIcon.QuestionAnswerIcon, +}; + +let wrapper; + +expect.addSnapshotSerializer(emotionSerializer); +expect.extend(matchers); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render Icon, Paragraph, Avatar', () => { + expect(wrapper.find(S.Icon).length).toBe(8); + expect(wrapper.find(IconContent).length).toBe(3); + expect(wrapper.find(S.Paragraph).length).toBe(4); + expect(wrapper.find(S.Avatar).length).toBe(1); + }); + + it('should render IconContent correctly', () => { + wrapper = mount(); + + expect(wrapper.find(S.Paragraph).text()).toBe(props.content); + expect(wrapper.find(S.Icon).prop('name')).toBe(props.name); + }); + + it('should render DropDownButton correctly', () => { + wrapper = mount(); + + expect(wrapper.find(S.DropDownMenuListItem).length).toBe(3); + expect(wrapper.find(S.DropDownBtn).length).toBe(1); + }); +}); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.tsx index f38aa733..1f82dcea 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.tsx @@ -56,7 +56,7 @@ export const UserProfileCard = withErrorBoundary(() => ( )); -const DropDownButton = () => ( +export const DropDownButton = () => ( More ... @@ -69,7 +69,7 @@ const DropDownButton = () => ( ); -const IconContent = ({ content, name }: Props) => ( +export const IconContent = ({ content, name }: Props) => ( From 568e22699472591ab7ae0a28cc13fcab26e4076e Mon Sep 17 00:00:00 2001 From: Dishebh Date: Sat, 16 May 2020 23:36:16 +0530 Subject: [PATCH 05/26] added test for opportunity list and corrected spelling of opportunity --- .../Components/OpportunityList.test.tsx | 38 +++ .../Components/OpportunityList.tsx} | 2 +- .../OpportunityList.test.tsx.snap | 295 ++++++++++++++++++ .../styles.ts | 0 src/ignitus-Shared/index.ts | 2 +- 5 files changed, 335 insertions(+), 2 deletions(-) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.test.tsx rename src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/{ignitus-OppurtunityList/Components/OppurtunityList.tsx => ignitus-OpportunityList/Components/OpportunityList.tsx} (97%) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/OpportunityList.test.tsx.snap rename src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/{ignitus-OppurtunityList => ignitus-OpportunityList}/styles.ts (100%) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.test.tsx new file mode 100644 index 00000000..9fd6c5f6 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.test.tsx @@ -0,0 +1,38 @@ +import React from 'react'; +import { mount, render } from 'enzyme'; +import emotionSerializer, { matchers } from 'jest-emotion'; +import OpportunityList, { BtnWithIcon, Opportunity } from './OpportunityList'; +import * as S from '../styles'; + +let wrapper; + +expect.addSnapshotSerializer(emotionSerializer); +expect.extend(matchers); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render BtnWithIcon', () => { + expect(wrapper.find(BtnWithIcon).length).toBe(1); + expect(wrapper.find(S.BtnContainerIcon).length).toBe(1); + expect(wrapper.find(S.BtnContainerText).length).toBe(1); + }); + + it('should render Opportunity', () => { + wrapper = mount(); + + expect(wrapper.find(Opportunity).length).toEqual(1); + expect(wrapper.find('img').length).toEqual(1); + expect(wrapper.find(S.OpportunityTitle).length).toEqual(1); + expect(wrapper.find(S.OpportunityData).length).toEqual(1); + expect(wrapper.find(S.OpportunitySubTitle).length).toEqual(1); + expect(wrapper.find(S.OpportunityDescription).length).toEqual(1); + }); +}); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OppurtunityList/Components/OppurtunityList.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.tsx similarity index 97% rename from src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OppurtunityList/Components/OppurtunityList.tsx rename to src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.tsx index fa663417..4d5c6e7f 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OppurtunityList/Components/OppurtunityList.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.tsx @@ -37,7 +37,7 @@ export const Opportunity: React.FunctionComponent = () => ( ); -const BtnWithIcon = () => ( +export const BtnWithIcon = () => ( Apply diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/OpportunityList.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/OpportunityList.test.tsx.snap new file mode 100644 index 00000000..dd466ec5 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/OpportunityList.test.tsx.snap @@ -0,0 +1,295 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +.emotion-13 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} + +.emotion-12 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + border-radius: 4px; + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); + background-color: #ffffff; + padding: 1rem; + width: 100%; +} + +.emotion-11 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-flex: 6; + -ms-flex: 6; + flex: 6; +} + +.emotion-0 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; +} + +.emotion-0 img { + max-width: 100%; + max-height: 100%; +} + +.emotion-10 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-flex: 5; + -ms-flex: 5; + flex: 5; + padding-left: 1rem; +} + +.emotion-3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + sflex-direction: row; +} + +.emotion-1 { + font-weight: 500; + font-size: 22px; + color: #000066; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; +} + +.emotion-2 { + font-size: 16px; + font-weight: 400; + color: #2D2D2D; + margin: 0; + color: #2D2D2D; + font-weight: 400; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + text-align: end; +} + +.emotion-4 { + font-size: 16px; + font-weight: 400; + color: #2D2D2D; + margin: 0; + font-weight: 400; + color: #9C9C9C; +} + +.emotion-9 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.emotion-5 { + font-size: 16px; + font-weight: 400; + color: #2D2D2D; + margin: 0; + font-weight: 400; + color: #2D2D2D; + margin-top: 1rem; +} + +.emotion-8 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + padding: 5px 10px; + border: 2px solid #000066; + border-radius: 5px; + cursor: pointer; +} + +.emotion-6 { + height: 1.5rem; + fill: #000066; +} + +.emotion-7 { + font-size: 16px; + font-weight: 300; + font-size: 18px; + font-weight: 400; + margin-bottom: 0; + margin-left: 10px; + color: #000066; +} + +
+
+
+
+ universityLogo +
+
+
+

+ PHD Project +

+

+ Posted 1 Month ago. +

+
+

+ Full Time | Munich, Germany + + 🇩🇪 + +

+
+

+ We are looking for a Python engineer to join our SEO team in Munich and drive organic user acquisition of Ignitus. +

+
+ + + Apply Icon + + + + +

+ Apply +

+
+
+
+
+
+
+`; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OppurtunityList/styles.ts b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/styles.ts similarity index 100% rename from src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OppurtunityList/styles.ts rename to src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/styles.ts diff --git a/src/ignitus-Shared/index.ts b/src/ignitus-Shared/index.ts index 7ae6f660..f1270912 100644 --- a/src/ignitus-Shared/index.ts +++ b/src/ignitus-Shared/index.ts @@ -97,7 +97,7 @@ export { export { Opportunity, -} from './ignitus-DesignSystem/ignitus-Organisms/ignitus-OppurtunityList/Components/OppurtunityList'; +} from './ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList'; export { UserProfileCard, From e5fb934f4ab928d5eee7ee9adaba8299c805d038 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Sun, 17 May 2020 00:06:49 +0530 Subject: [PATCH 06/26] added test for ignitus-DashBoardOpportunity --- .../Components/DashBoardOpportunity.test.tsx | 42 ++++++ .../Components/DashBoardOpportunity.tsx | 2 +- .../DashBoardOpportunity.test.tsx.snap | 122 ++++++++++++++++++ 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.test.tsx create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/__snapshots__/DashBoardOpportunity.test.tsx.snap diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.test.tsx new file mode 100644 index 00000000..bc7bcb27 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.test.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import { mount, render } from 'enzyme'; +import emotionSerializer, { matchers } from 'jest-emotion'; +import { DashBoardOpportunity, Card } from './DashBoardOpportunity'; +import { Opportunity } from '../types'; +import * as S from '../style'; + +const props: Opportunity = { + title: 'Title', + description: 'Description', + subtitle: 'subtitle', + src: + 'https://storage.googleapis.com/ignitus_assets/ig-opportunities/universityOfMelbourne.png', +}; + +let wrapper; + +expect.addSnapshotSerializer(emotionSerializer); +expect.extend(matchers); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render Card component', () => { + expect(wrapper.find(Card).length).toEqual(1); + + wrapper = mount(); + + expect(wrapper.find('img').prop('src')).toEqual(props.src); + expect(wrapper.find('img').prop('alt')).toEqual(props.title); + expect(wrapper.find(S.Title).text()).toEqual(props.title); + expect(wrapper.find(S.SubTitle).text()).toEqual(props.subtitle); + expect(wrapper.find(S.Description).text()).toEqual(props.description); + }); +}); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.tsx index d27bf3c9..dce0da35 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.tsx @@ -12,7 +12,7 @@ export const DashBoardOpportunity = ({ ); -const Card = ({ title, description, subtitle, src }: Opportunity) => ( +export const Card = ({ title, description, subtitle, src }: Opportunity) => ( diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/__snapshots__/DashBoardOpportunity.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/__snapshots__/DashBoardOpportunity.test.tsx.snap new file mode 100644 index 00000000..6a48abfd --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/__snapshots__/DashBoardOpportunity.test.tsx.snap @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +.emotion-6 { + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); + background-color: #ffffff; + border-radius: 20px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + margin: 0.5rem; +} + +.emotion-5 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} + +.emotion-0 { + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; +} + +.emotion-0 img { + max-width: 100%; + max-height: 100%; + border-top-left-radius: 20px; + border-bottom-left-radius: 20px; +} + +.emotion-4 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-flex: 3; + -ms-flex: 3; + flex: 3; + margin-left: 20px; + padding: 0.5rem; +} + +.emotion-1 { + font-weight: 500; + font-size: 22px; + color: #000066; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; +} + +.emotion-2 { + font-weight: 400; + color: #4D4D4D; + font-size: 14px; +} + +.emotion-3 { + font-size: 16px; + font-weight: 400; + color: #2D2D2D; + margin: 0; + font-weight: 400; + color: #2D2D2D; + margin-right: 1.5rem; + margin-top: 0.5rem; +} + +
+
+
+ Title +
+
+

+ Title +

+

+ subtitle +

+

+ Description +

+
+
+
+`; From 577c805917233852f291e8f395b6ba15e0955e26 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Sun, 17 May 2020 01:48:09 +0530 Subject: [PATCH 07/26] added test for avatars --- .../ignitus-Avatar/Components/Avatar.test.tsx | 43 +++++++++++++++++++ .../__snapshots__/Avatar.test.tsx.snap | 13 ++++++ 2 files changed, 56 insertions(+) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/__snapshots__/Avatar.test.tsx.snap diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx new file mode 100644 index 00000000..070a0c19 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx @@ -0,0 +1,43 @@ +import React from 'react'; +import { mount, render } from 'enzyme'; +import emotionSerializer, { matchers } from 'jest-emotion'; +import { Avatar } from './Avatar'; +import { AvatarImage } from '../styles'; +import { avatar } from '../types'; + +const pre = 'https://storage.googleapis.com/ignitus_assets/ig-avatars/'; + +const avatarNames = ['grant', 'melanie', 'george', 'eugene']; + +const randomAvatar = () => + avatarNames[Math.floor(Math.random() * avatarNames.length)]; + +const props: avatar = { + name: randomAvatar(), + src: `${pre}${randomAvatar()}.png`, +}; + +let wrapper; + +expect.addSnapshotSerializer(emotionSerializer); +expect.extend(matchers); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render Avatar images', () => { + expect(wrapper.find(AvatarImage).length).toBe(1); + + wrapper = mount(); + + expect(wrapper.find(AvatarImage).prop('src')).toEqual(props.src); + expect(wrapper.find(AvatarImage).prop('name')).toEqual(props.name); + }); +}); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/__snapshots__/Avatar.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/__snapshots__/Avatar.test.tsx.snap new file mode 100644 index 00000000..f6f79ac8 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/__snapshots__/Avatar.test.tsx.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +.emotion-0 { + max-width: 9rem; +} + +melanie +`; From 78aa990c85b498b74205c415186d13ba730d2214 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Sun, 17 May 2020 14:56:42 +0530 Subject: [PATCH 08/26] removed enzyme snapshot testing as the avatar is always random --- .../ignitus-Avatar/Components/Avatar.test.tsx | 11 ++++------- .../Components/__snapshots__/Avatar.test.tsx.snap | 13 ------------- 2 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/__snapshots__/Avatar.test.tsx.snap diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx index 070a0c19..34697e2f 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { mount, render } from 'enzyme'; +import { mount } from 'enzyme'; import emotionSerializer, { matchers } from 'jest-emotion'; import { Avatar } from './Avatar'; import { AvatarImage } from '../styles'; @@ -7,7 +7,7 @@ import { avatar } from '../types'; const pre = 'https://storage.googleapis.com/ignitus_assets/ig-avatars/'; -const avatarNames = ['grant', 'melanie', 'george', 'eugene']; +const avatarNames = ['grant']; const randomAvatar = () => avatarNames[Math.floor(Math.random() * avatarNames.length)]; @@ -17,6 +17,8 @@ const props: avatar = { src: `${pre}${randomAvatar()}.png`, }; +console.log('name: ', props.name); + let wrapper; expect.addSnapshotSerializer(emotionSerializer); @@ -27,11 +29,6 @@ describe('', () => { wrapper = mount(); }); - it('should render', () => { - wrapper = render(); - expect(wrapper).toMatchSnapshot(); - }); - it('should render Avatar images', () => { expect(wrapper.find(AvatarImage).length).toBe(1); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/__snapshots__/Avatar.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/__snapshots__/Avatar.test.tsx.snap deleted file mode 100644 index f6f79ac8..00000000 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/__snapshots__/Avatar.test.tsx.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` should render 1`] = ` -.emotion-0 { - max-width: 9rem; -} - -melanie -`; From 33e9c63248068971e423f39a9618e65bd9e639b7 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Sun, 17 May 2020 18:34:53 +0530 Subject: [PATCH 09/26] removed Card mount --- .../Components/DashBoardOpportunity.test.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.test.tsx index bc7bcb27..ab05bf1c 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-DashBoardOpportunity/Components/DashBoardOpportunity.test.tsx @@ -30,9 +30,6 @@ describe('', () => { it('should render Card component', () => { expect(wrapper.find(Card).length).toEqual(1); - - wrapper = mount(); - expect(wrapper.find('img').prop('src')).toEqual(props.src); expect(wrapper.find('img').prop('alt')).toEqual(props.title); expect(wrapper.find(S.Title).text()).toEqual(props.title); From 59b7d869775db59adcdba892e1652f67c41cea41 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Sun, 17 May 2020 18:40:51 +0530 Subject: [PATCH 10/26] updated avatars array and removed unnecessary code lines --- .../ignitus-Avatar/Components/Avatar.test.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx index 34697e2f..a2d1b928 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx @@ -1,13 +1,12 @@ import React from 'react'; import { mount } from 'enzyme'; -import emotionSerializer, { matchers } from 'jest-emotion'; import { Avatar } from './Avatar'; import { AvatarImage } from '../styles'; import { avatar } from '../types'; const pre = 'https://storage.googleapis.com/ignitus_assets/ig-avatars/'; -const avatarNames = ['grant']; +const avatarNames = ['grant', 'melanie', 'george', 'eugene']; const randomAvatar = () => avatarNames[Math.floor(Math.random() * avatarNames.length)]; @@ -17,13 +16,8 @@ const props: avatar = { src: `${pre}${randomAvatar()}.png`, }; -console.log('name: ', props.name); - let wrapper; -expect.addSnapshotSerializer(emotionSerializer); -expect.extend(matchers); - describe('', () => { beforeEach(() => { wrapper = mount(); From e99284864f2eac9d23a58975850ec86bec94fcbb Mon Sep 17 00:00:00 2001 From: Dishebh Date: Mon, 18 May 2020 13:44:16 +0530 Subject: [PATCH 11/26] added test for ignitus-NotFound --- .../__snapshots__/index.test.tsx.snap | 291 ++++++++++++++++++ .../Components/index.test.tsx | 27 ++ .../ignitus-NotFound/Components/index.tsx | 10 +- .../ignitus-Layout/ignitus-NotFound/style.ts | 2 +- 4 files changed, 325 insertions(+), 5 deletions(-) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/__snapshots__/index.test.tsx.snap create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/__snapshots__/index.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/__snapshots__/index.test.tsx.snap new file mode 100644 index 00000000..359bdd0b --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/__snapshots__/index.test.tsx.snap @@ -0,0 +1,291 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +@keyframes animation-0 { + 0% { + -webkit-transform: translate(1px,1em); + -ms-transform: translate(1px,1em); + transform: translate(1px,1em); + } + + 50% { + -webkit-transform: translate(0,1em); + -ms-transform: translate(0,1em); + transform: translate(0,1em); + } + + 100% { + -webkit-transform: translate(-1px,1em); + -ms-transform: translate(-1px,1em); + transform: translate(-1px,1em); + } +} + +@keyframes animation-1 { + 0%, 30%, 55%, 90%, 100% { + -webkit-transform: translate(0,0); + -ms-transform: translate(0,0); + transform: translate(0,0); + } + + 10%, 25% { + -webkit-transform: translate(0,20px); + -ms-transform: translate(0,20px); + transform: translate(0,20px); + } + + 65% { + -webkit-transform: translate(-20px,0); + -ms-transform: translate(-20px,0); + transform: translate(-20px,0); + } + + 80% { + -webkit-transform: translate(20px,0); + -ms-transform: translate(20px,0); + transform: translate(20px,0); + } +} + +@keyframes animation-2 { + to { + text-indent: -373px; + } +} + +.emotion-9 { + background: #F7F7F7; +} + +.emotion-2 { + display: block; + position: relative; + width: 200px; + margin: 10% auto 0; + -webkit-animation: animation-0 0.2s infinite; + animation: animation-0 0.2s infinite; + height: 100%; +} + +.emotion-2::after { + content: ''; + width: 20px; + height: 20px; + background: white; + position: absolute; + top: 30px; + left: 25px; + border-radius: 50%; + box-shadow: 125px 0 0 white; + -webkit-animation: animation-1 2.5s infinite; + animation: animation-1 2.5s infinite; +} + +.emotion-0 { + position: relative; + display: inline-block; + background: #000066; + width: 75px; + height: 80px; + border-radius: 50%; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} + +.emotion-0::after { + content: ''; + position: absolute; + border-bottom: 2px solid #000066; + width: 70px; + height: 50px; + left: 0px; + bottom: -10px; + border-radius: 50%; +} + +.emotion-0::before { + bottom: auto; + top: -100px; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + left: 0; +} + +.emotion-0:nth-of-type(2) { + float: right; + -webkit-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + transform: rotate(-45deg); +} + +.emotion-0:nth-of-type(2)::after { + left: 5px; +} + +.emotion-0:nth-of-type(3) { + display: none; +} + +.emotion-3 { + margin-top: 5rem; + text-align: center; +} + +.emotion-3::before { + content: 'Got lost? How......? Ahhhh...!'; + color: #000066; + width: 120px; + font-size: 30px; + overflow: hidden; + display: inline-block; + white-space: nowrap; + -webkit-animation: animation-2 2s infinite steps(3); + animation: animation-2 2s infinite steps(3); +} + +.emotion-8 { + text-align: center; + margin-bottom: 6rem; +} + +.emotion-6 { + color: #000066; +} + +.emotion-4 { + font-size: 16px; + font-weight: 400; + color: #2D2D2D; + margin: 0; + color: #000066; + font-size: 16px; +} + +.emotion-7 { + border-radius: 5px; + border: none; + cursor: pointer; + outline: none; + padding: 16px 32px; + text-align: center; + line-height: 1rem; + margin: 0.5rem; + outline: none; + font-size: 18px; + font-weight: 400; + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; + outline: none; + color: #ffffff; + background-color: #000066; + padding: 16px 32px; + font-size: 18px; + border-radius: 5px; + border: none; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.emotion-7:hover, +.emotion-7:focus { + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.05); +} + +.emotion-7 a { + color: #ffffff; +} + +.emotion-7:hover, +.emotion-7:focus { + background-color: #F9BF64; + color: #000066; + outline: none; +} + +.emotion-7:hover a, +.emotion-7:focus a { + color: #000066; +} + +.emotion-7:hover svg, +.emotion-7:focus svg { + fill: #000066; +} + +.emotion-7 a { + color: #ffffff; +} + +.emotion-7:hover { + color: #000066; +} + +.emotion-7:hover a { + color: #000066; + -webkit-text-decoration: none; + text-decoration: none; +} + +
+
+
+
+
+

+

+
+

+ Looks like you're lost! +

+

+ The page you are looking for is not available! + + 🔨 + +

+
+ +
+
+`; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx new file mode 100644 index 00000000..aeaf70bd --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import { mount, render } from 'enzyme'; +import emotionSerializer from 'jest-emotion'; +import { Notfound } from './index'; +import * as S from '../style'; + +let wrapper; + +expect.addSnapshotSerializer(emotionSerializer); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render Eyes, Message, Button, AnimationText components', () => { + expect(wrapper.find(S.Eyes).length).toBe(2); + expect(wrapper.find(S.Message).length).toBe(1); + expect(wrapper.find(S.StyledButton).length).toBe(1); + expect(wrapper.find(S.AnimationText).length).toBe(1); + }); +}); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.tsx index 32cf4bbd..225c87d7 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Link } from 'react-router-dom'; +import { Link, BrowserRouter } from 'react-router-dom'; import * as S from '../style'; export const Notfound = () => ( @@ -20,9 +20,11 @@ export const Notfound = () => ( - - Home Page - + + + Home Page + + diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/style.ts b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/style.ts index 24d961f3..f85273d5 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/style.ts +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/style.ts @@ -122,7 +122,7 @@ export const MessageContainer = styled.div` margin-bottom: 6rem; `; -export const Message = styled.p` +export const Message = styled.div` color: ${C.IgnitusBlue}; `; From f0138d775bb1104b7996959e8034c910c957cb3f Mon Sep 17 00:00:00 2001 From: Dishebh Date: Mon, 18 May 2020 13:56:37 +0530 Subject: [PATCH 12/26] added test for ignitus-UnderConstruction --- .../__snapshots__/index.test.tsx.snap | 96 +++++++++++++++++++ .../Components/index.test.tsx | 27 ++++++ 2 files changed, 123 insertions(+) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/__snapshots__/index.test.tsx.snap create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/index.test.tsx diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/__snapshots__/index.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/__snapshots__/index.test.tsx.snap new file mode 100644 index 00000000..ad7ff1c7 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/__snapshots__/index.test.tsx.snap @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +.emotion-5 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + margin-top: 6rem; + margin-bottom: 6rem; +} + +.emotion-4 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + margin-top: 2rem; +} + +.emotion-1 { + font-weight: 500; + font-size: 22px; + color: #000066; +} + +.emotion-2 { + font-size: 16px; + font-weight: 400; + color: #2D2D2D; + margin: 0; +} + +
+ Site Under Build +
+

+ Our site is under maintenance +

+

+ We are working on making better experiences for you. + + 🔨 + +

+

+ We should be back shortly, Thank you for the patience. + + ☘️ + +

+
+
+`; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/index.test.tsx new file mode 100644 index 00000000..b114b1af --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/index.test.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import { mount, render } from 'enzyme'; +import emotionSerializer from 'jest-emotion'; +import { WebsiteUnderConstruction } from './index'; +import * as S from '../styles'; +import { Heading3, Paragraph } from '../../../ignitus-Atoms/typography'; + +let wrapper; + +expect.addSnapshotSerializer(emotionSerializer); + +describe('', () => { + beforeEach(() => { + wrapper = mount(); + }); + + it('should render', () => { + wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render Img, Heading, Paragraph components', () => { + expect(wrapper.find(S.Img).length).toBe(1); + expect(wrapper.find(Heading3).length).toBe(1); + expect(wrapper.find(Paragraph).length).toBe(2); + }); +}); From bd3e677ee4d482c280924fa827b47796e532beb0 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Tue, 19 May 2020 14:21:57 +0530 Subject: [PATCH 13/26] removed tests except snapshot matching --- .../Components/index.test.tsx | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/index.test.tsx index b114b1af..56adf2fc 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/index.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-UnderContruction/Components/index.test.tsx @@ -1,27 +1,13 @@ import React from 'react'; -import { mount, render } from 'enzyme'; +import { render } from 'enzyme'; import emotionSerializer from 'jest-emotion'; import { WebsiteUnderConstruction } from './index'; -import * as S from '../styles'; -import { Heading3, Paragraph } from '../../../ignitus-Atoms/typography'; - -let wrapper; expect.addSnapshotSerializer(emotionSerializer); describe('', () => { - beforeEach(() => { - wrapper = mount(); - }); - it('should render', () => { - wrapper = render(); + const wrapper = render(); expect(wrapper).toMatchSnapshot(); }); - - it('should render Img, Heading, Paragraph components', () => { - expect(wrapper.find(S.Img).length).toBe(1); - expect(wrapper.find(Heading3).length).toBe(1); - expect(wrapper.find(Paragraph).length).toBe(2); - }); }); From 8dd6f7542fc19197a605ae3efd4921ca723bc428 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Tue, 19 May 2020 14:27:08 +0530 Subject: [PATCH 14/26] removed tests except snapshot matching --- .../ignitus-NotFound/Components/index.test.tsx | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx index aeaf70bd..aac2cc06 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx @@ -1,27 +1,13 @@ import React from 'react'; -import { mount, render } from 'enzyme'; +import { render } from 'enzyme'; import emotionSerializer from 'jest-emotion'; import { Notfound } from './index'; -import * as S from '../style'; - -let wrapper; expect.addSnapshotSerializer(emotionSerializer); describe('', () => { - beforeEach(() => { - wrapper = mount(); - }); - it('should render', () => { - wrapper = render(); + const wrapper = render(); expect(wrapper).toMatchSnapshot(); }); - - it('should render Eyes, Message, Button, AnimationText components', () => { - expect(wrapper.find(S.Eyes).length).toBe(2); - expect(wrapper.find(S.Message).length).toBe(1); - expect(wrapper.find(S.StyledButton).length).toBe(1); - expect(wrapper.find(S.AnimationText).length).toBe(1); - }); }); From 8b365ce7172d5527a5029de1fb2c8f2f57b12432 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Tue, 19 May 2020 15:06:48 +0530 Subject: [PATCH 15/26] added round borders --- .../ignitus-ScrollBar/styles.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts index efa72fca..8d4d00c1 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts @@ -10,27 +10,19 @@ export const Scroll = styled.div` margin-bottom: 25px; ::-webkit-scrollbar { - width: 10px; + width: 12px; background: #f5f5f5; } ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); - background: #f5f5f5; + border-radius: 10px; + background-color: #f5f5f5; } ::-webkit-scrollbar-thumb { + border-radius: 10px; background-color: #f90; - background-image: -webkit-linear-gradient( - 90deg, - rgba(255, 255, 255, 0.2) 25%, - transparent 25%, - transparent 50%, - rgba(255, 255, 255, 0.2) 50%, - rgba(255, 255, 255, 0.2) 75%, - transparent 75%, - transparent - ); } `; From 1cc3df57fafff4fcd3cec044df57f16a493b794c Mon Sep 17 00:00:00 2001 From: Dishebh Date: Tue, 19 May 2020 16:43:30 +0530 Subject: [PATCH 16/26] added handleClick prop --- .../Components/ToggleButtoninterface.test.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx index 3fbddcc8..8d17ae1f 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx @@ -13,6 +13,7 @@ const props: ToggleButtonInterfaceProps = { leftButtonContent: <> Left , rightButtonContent: <> Right , }, + handleClick: jest.fn(), }; let wrapper; @@ -47,4 +48,11 @@ describe('', () => { props.children.rightButtonContent, ); }); + + it('should simulate both side Clicks', () => { + wrapper.find(ButtonLeft).simulate('click'); + expect(props.handleClick).toHaveBeenCalledWith('left'); + wrapper.find(ButtonRight).simulate('click'); + expect(props.handleClick).toHaveBeenCalledWith('right'); + }); }); From 0bb415b7afbe868ad7ab829849eaa2283c3bb2f9 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Wed, 20 May 2020 11:45:14 +0530 Subject: [PATCH 17/26] replaced UserProfileCard mount --- .../ignitus-ProfileCard/Components/index.test.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.test.tsx index b5d8ade6..898202bc 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components/index.test.tsx @@ -17,16 +17,14 @@ expect.addSnapshotSerializer(emotionSerializer); expect.extend(matchers); describe('', () => { - beforeEach(() => { - wrapper = mount(); - }); - it('should render', () => { wrapper = render(); expect(wrapper).toMatchSnapshot(); }); it('should render Icon, Paragraph, Avatar', () => { + wrapper = mount(); + expect(wrapper.find(S.Icon).length).toBe(8); expect(wrapper.find(IconContent).length).toBe(3); expect(wrapper.find(S.Paragraph).length).toBe(4); From 1081b2b4d5ed1be07bba9fba7ad0e0b2b370583b Mon Sep 17 00:00:00 2001 From: Rawat Date: Thu, 21 May 2020 14:18:38 +0200 Subject: [PATCH 18/26] =?UTF-8?q?Minor=20Updates=20=F0=9F=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ignitus-Molecules/ignitus-ScrollBar/styles.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts index 8d4d00c1..1e4f9063 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/styles.ts @@ -15,7 +15,7 @@ export const Scroll = styled.div` } ::-webkit-scrollbar-track { - -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); + box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); border-radius: 10px; background-color: #f5f5f5; } From 4a01adfb4ac57e717db715da5f17028a73a60710 Mon Sep 17 00:00:00 2001 From: Rawat Date: Thu, 21 May 2020 14:57:32 +0200 Subject: [PATCH 19/26] =?UTF-8?q?Minor=20Updates=20=F0=9F=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ignitus-Avatar/Components/Avatar.test.tsx | 25 +++++++------------ .../ignitus-Avatar/Components/Avatar.tsx | 5 ++-- .../ignitus-Organisms/ignitus-Avatar/types.ts | 6 +++++ 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx index a2d1b928..2666a58c 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.test.tsx @@ -2,20 +2,15 @@ import React from 'react'; import { mount } from 'enzyme'; import { Avatar } from './Avatar'; import { AvatarImage } from '../styles'; -import { avatar } from '../types'; - -const pre = 'https://storage.googleapis.com/ignitus_assets/ig-avatars/'; - -const avatarNames = ['grant', 'melanie', 'george', 'eugene']; - -const randomAvatar = () => - avatarNames[Math.floor(Math.random() * avatarNames.length)]; - -const props: avatar = { - name: randomAvatar(), - src: `${pre}${randomAvatar()}.png`, +import { avatar, AvatarImageProps } from '../types'; +import { avatars } from '../avatars'; + +const randomAvatar = () => avatars[Math.floor(Math.random() * avatars.length)]; +const av: avatar = randomAvatar(); +const props: AvatarImageProps = { + alt: av.name, + src: av.src, }; - let wrapper; describe('', () => { @@ -25,10 +20,8 @@ describe('', () => { it('should render Avatar images', () => { expect(wrapper.find(AvatarImage).length).toBe(1); - wrapper = mount(); - expect(wrapper.find(AvatarImage).prop('src')).toEqual(props.src); - expect(wrapper.find(AvatarImage).prop('name')).toEqual(props.name); + expect(wrapper.find(AvatarImage).prop('alt')).toEqual(props.alt); }); }); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.tsx index c6a15fff..0aa9b035 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/Components/Avatar.tsx @@ -6,9 +6,8 @@ import { avatar } from '../types'; const randomAvatar = () => avatars[Math.floor(Math.random() * avatars.length)]; export const Avatar: React.FC> = ({ - ...all + ...rest }) => { const av: avatar = randomAvatar(); - - return ; + return ; }; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/types.ts b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/types.ts index 6aaa8855..2d2e4ee3 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/types.ts +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar/types.ts @@ -2,3 +2,9 @@ export type avatar = { name: string; src: string; }; + +/** As AvatarImage represents img feel free to add more props here, as supports lot of other attributes. */ +export type AvatarImageProps = { + src: string; + alt: string; +}; From f88937975af5c53fb5d77b64cbe680c0e670df2b Mon Sep 17 00:00:00 2001 From: Rawat Date: Thu, 21 May 2020 15:16:18 +0200 Subject: [PATCH 20/26] =?UTF-8?q?Fixes=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__snapshots__/index.test.tsx.snap | 307 ++---------------- .../Components/index.test.tsx | 9 +- .../ignitus-NotFound/Components/index.tsx | 10 +- 3 files changed, 33 insertions(+), 293 deletions(-) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/__snapshots__/index.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/__snapshots__/index.test.tsx.snap index 359bdd0b..2834c921 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/__snapshots__/index.test.tsx.snap +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/__snapshots__/index.test.tsx.snap @@ -1,291 +1,28 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[` should render 1`] = ` -@keyframes animation-0 { - 0% { - -webkit-transform: translate(1px,1em); - -ms-transform: translate(1px,1em); - transform: translate(1px,1em); + -
-
-
-
-

-

-
-

- Looks like you're lost! -

-

- The page you are looking for is not available! - - 🔨 - -

-
- -
-
+ + `; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx index aac2cc06..36215e41 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.test.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { render } from 'enzyme'; +import { shallow } from 'enzyme'; +import { BrowserRouter as Router } from 'react-router-dom'; import emotionSerializer from 'jest-emotion'; import { Notfound } from './index'; @@ -7,7 +8,11 @@ expect.addSnapshotSerializer(emotionSerializer); describe('', () => { it('should render', () => { - const wrapper = render(); + const wrapper = shallow( + + + , + ); expect(wrapper).toMatchSnapshot(); }); }); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.tsx index 225c87d7..32cf4bbd 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Layout/ignitus-NotFound/Components/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Link, BrowserRouter } from 'react-router-dom'; +import { Link } from 'react-router-dom'; import * as S from '../style'; export const Notfound = () => ( @@ -20,11 +20,9 @@ export const Notfound = () => ( - - - Home Page - - + + Home Page + From bf2cdf2abd5afd9cdb3be43e7922f79e72cc4f74 Mon Sep 17 00:00:00 2001 From: Rawat Date: Thu, 21 May 2020 18:13:27 +0200 Subject: [PATCH 21/26] refactoring --- .../ignitus-UserInterfaceBookRoutes/index.tsx | 4 +- .../Components/OpportunityList.tsx | 53 ------------------- ...pportunityList.test.tsx => index.test.tsx} | 2 +- .../Components/index.tsx | 39 ++++++++++++++ .../ignitus-OpportunityList/styles.ts | 4 +- src/ignitus-Shared/index.ts | 10 ++-- .../Atoms/interfaceIcons/Components/index.tsx | 4 +- .../Components/index.tsx | 10 +--- .../interfaceOpportunity/Components/index.tsx | 12 ----- .../Organisms/interfaceOpportunity/types.ts | 1 - .../Components/index.tsx | 24 +++++++++ .../interfaceOpportunityList/constants.ts | 23 ++++++++ .../interfaceOpportunityList/types.ts | 8 +++ 13 files changed, 108 insertions(+), 86 deletions(-) delete mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.tsx rename src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/{OpportunityList.test.tsx => index.test.tsx} (93%) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.tsx delete mode 100644 src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunity/Components/index.tsx delete mode 100644 src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunity/types.ts create mode 100644 src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/Components/index.tsx create mode 100644 src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/constants.ts create mode 100644 src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/types.ts diff --git a/src/ignitus-Routes/ignitus-UserInterfaceBookRoutes/index.tsx b/src/ignitus-Routes/ignitus-UserInterfaceBookRoutes/index.tsx index 6ee25985..71e4b674 100644 --- a/src/ignitus-Routes/ignitus-UserInterfaceBookRoutes/index.tsx +++ b/src/ignitus-Routes/ignitus-UserInterfaceBookRoutes/index.tsx @@ -15,7 +15,7 @@ import { InterfaceSideNavigation } from '../../ignitus-UserInterfaceBook/Interfa import { interfaceDropDown } from '../../ignitus-UserInterfaceBook/Components/Atoms/interfaceDropDown/Components'; import { interfaceCheckBox } from '../../ignitus-UserInterfaceBook/Components/Atoms/interfaceCheckBox/Components'; import { interfaceInput } from '../../ignitus-UserInterfaceBook/Components/Atoms/interfaceInput/Components'; -import { interfaceOpportunity } from '../../ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunity/Components'; +import { interfaceOpportunityList } from '../../ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/Components'; import { interfaceSavedOpportunity } from '../../ignitus-UserInterfaceBook/Components/Layouts/interfaceSavedOpportunity/Components'; import { interfaceSearchInput } from '../../ignitus-UserInterfaceBook/Components/Atoms/interfaceSearchInput/Components'; import { interfaceSeparator } from '../../ignitus-UserInterfaceBook/Components/Atoms/interfaceSeparator/Components'; @@ -83,7 +83,7 @@ export const UserInterfaceBookRoutes: React.FunctionComponent = () => ( ( - - - - universityLogo - - - - PHD Project - Posted 1 Month ago. - - - - Full Time | Munich, Germany{' '} - - 🇩🇪 - - - - - {' '} - We are looking for a Python engineer to join our SEO team in Munich - and drive organic user acquisition of Ignitus. - - - - - - -); - -export const BtnWithIcon = () => ( - - - Apply - -); - -const OpportunityList = () => ( - - - -); - -export default withErrorBoundary(OpportunityList); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.test.tsx similarity index 93% rename from src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.test.tsx rename to src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.test.tsx index 9fd6c5f6..8a3751af 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { mount, render } from 'enzyme'; import emotionSerializer, { matchers } from 'jest-emotion'; -import OpportunityList, { BtnWithIcon, Opportunity } from './OpportunityList'; +import OpportunityList, { BtnWithIcon, Opportunity } from '.'; import * as S from '../styles'; let wrapper; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.tsx new file mode 100644 index 00000000..8011cd71 --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.tsx @@ -0,0 +1,39 @@ +import React from 'react'; +import * as S from '../styles'; +import { withErrorBoundary } from '../../../../ignitus-ErrorHandlingComponents/errorBoundary'; + +export const Opportunity = withErrorBoundary( + ({ title, description, picture, type, location, datePosted }) => ( + + + + universityLogo + + + + {title} + {datePosted} + + + + {type} | {location}{' '} + + 🇩🇪 + + + + {description} + + + + + + ), +); + +export const BtnWithIcon = () => ( + + + Apply + +); diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/styles.ts b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/styles.ts index 46730266..5f3430e5 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/styles.ts +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/styles.ts @@ -5,8 +5,6 @@ import { flexibleColDiv, flexibleRowDiv, Paragraph } from '../../shared'; import { Normal, MD } from '../../ignitus-Atoms/fonts'; import ApplyIcon from '../../ignitus-Assets/ignitus-Icons/applyIcon/applyIcon'; -export const OpportunityList = styled(flexibleColDiv)``; - export const OpportunityContainer = styled(flexibleRowDiv)` border-radius: 4px; box-shadow: 0 2px 4px 0 ${C.boxShadowColor}; @@ -80,7 +78,7 @@ export const OpportunityDescription = styled(T.Paragraph)` export const OpportunityDateTitle = styled.div` display: flex; - sflex-direction: row; + flex-direction: row; `; export const OpportunityTitle = styled(T.Heading3)` diff --git a/src/ignitus-Shared/index.ts b/src/ignitus-Shared/index.ts index f1270912..abe248ac 100644 --- a/src/ignitus-Shared/index.ts +++ b/src/ignitus-Shared/index.ts @@ -1,4 +1,5 @@ /* eslint-disable import/no-cycle */ + /** * => ignitus-DesgnSystem */ @@ -75,6 +76,11 @@ export { /** * ignitus-Organisms */ + +export { + Opportunity, +} from './ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components'; + export { Avatar, } from './ignitus-DesignSystem/ignitus-Organisms/ignitus-Avatar'; @@ -95,10 +101,6 @@ export { OptionalNavigation, } from './ignitus-DesignSystem/ignitus-Organisms/ignitus-Navigation/Components'; -export { - Opportunity, -} from './ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/OpportunityList'; - export { UserProfileCard, } from './ignitus-DesignSystem/ignitus-Organisms/ignitus-ProfileCard/Components'; diff --git a/src/ignitus-UserInterfaceBook/Components/Atoms/interfaceIcons/Components/index.tsx b/src/ignitus-UserInterfaceBook/Components/Atoms/interfaceIcons/Components/index.tsx index 92b50242..67c83a9c 100644 --- a/src/ignitus-UserInterfaceBook/Components/Atoms/interfaceIcons/Components/index.tsx +++ b/src/ignitus-UserInterfaceBook/Components/Atoms/interfaceIcons/Components/index.tsx @@ -42,9 +42,9 @@ export const interfaceIcons: React.FC = () => ( ); -type IconsT = { +type IconsTypes = { icons: AppIcon[]; }; -const IconsMapper: Function = ({ icons }: IconsT): JSX.Element[] => +const IconsMapper: Function = ({ icons }: IconsTypes): JSX.Element[] => icons.map((icon: AppIcon) => ); diff --git a/src/ignitus-UserInterfaceBook/Components/Layouts/interfaceSavedOpportunity/Components/index.tsx b/src/ignitus-UserInterfaceBook/Components/Layouts/interfaceSavedOpportunity/Components/index.tsx index 10079e07..5ffa4dab 100644 --- a/src/ignitus-UserInterfaceBook/Components/Layouts/interfaceSavedOpportunity/Components/index.tsx +++ b/src/ignitus-UserInterfaceBook/Components/Layouts/interfaceSavedOpportunity/Components/index.tsx @@ -11,14 +11,8 @@ export const interfaceSavedOpportunity: React.FC = () => ( Opportunities Saved Layout
- {List.map(({ title, description, subtitle, src }: Opportunity) => ( - + {List.map(({ ...rest }: Opportunity, index) => ( + ))} diff --git a/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunity/Components/index.tsx b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunity/Components/index.tsx deleted file mode 100644 index e7e30ee5..00000000 --- a/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunity/Components/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -import { Opportunity, Heading2 } from '../../../../../ignitus-Shared'; -import { Interface } from '../../../../styles'; - -export const interfaceOpportunity: React.FC = () => ( - - Opportunity -
- -
-); diff --git a/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunity/types.ts b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunity/types.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunity/types.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/Components/index.tsx b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/Components/index.tsx new file mode 100644 index 00000000..4b362632 --- /dev/null +++ b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/Components/index.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import styled from '@emotion/styled'; +import { Opportunity, Heading2 } from '../../../../../ignitus-Shared'; +import { Interface } from '../../../../styles'; +import { flexibleColDiv } from '../../../../../ignitus-Shared/ignitus-DesignSystem/shared'; +import { OpportunityData } from '../constants'; +import { OpportunityDataType } from '../types'; + +export const OpportunityList = styled(flexibleColDiv)``; + +export const interfaceOpportunityList: React.FC = () => ( + + Opportunity List +
+ + {OpportunityData.map(({ ...rest }, index) => ( + + +
+
+ ))} +
+
+); diff --git a/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/constants.ts b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/constants.ts new file mode 100644 index 00000000..e54ea42b --- /dev/null +++ b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/constants.ts @@ -0,0 +1,23 @@ +import { OpportunityDataType } from './types'; + +export const OpportunityData: OpportunityDataType[] = [ + { + title: 'PHD Project', + type: 'Full Time', + location: 'Munich, Germany', + description: 'We are looking for a a PHD Student to join us.', + datePosted: 'Posted 1 Month ago', + picture: + 'https://storage.googleapis.com/ignitus_assets/ig-avatars/eugene.png', + }, + { + title: 'Software Engineer', + type: 'Full Time', + location: 'Berlin, Germany', + description: + 'We are looking for a Software engineer to join our SEO team in Munich and drive organic user acquisition of Ignitus.', + datePosted: 'Posted 2 Month ago', + picture: + 'https://storage.googleapis.com/ignitus_assets/ig-avatars/eugene.png', + }, +]; diff --git a/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/types.ts b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/types.ts new file mode 100644 index 00000000..8ba6fefc --- /dev/null +++ b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/types.ts @@ -0,0 +1,8 @@ +export type OpportunityDataType = { + title: string; + picture: string; + description: string; + datePosted: string; + type: string; + location: string; +}; From 14d7ec0d0dd33a5ecc4b5d50e49fc2c86da2ae5a Mon Sep 17 00:00:00 2001 From: Rawat Date: Thu, 21 May 2020 18:26:00 +0200 Subject: [PATCH 22/26] =?UTF-8?q?Tests=20updated=20=F0=9F=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...List.test.tsx.snap => index.test.tsx.snap} | 135 +++++++----------- .../Components/index.test.tsx | 8 +- .../Components/index.tsx | 4 +- .../Components/index.tsx | 7 +- 4 files changed, 64 insertions(+), 90 deletions(-) rename src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/{OpportunityList.test.tsx.snap => index.test.tsx.snap} (62%) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/OpportunityList.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/index.test.tsx.snap similarity index 62% rename from src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/OpportunityList.test.tsx.snap rename to src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/index.test.tsx.snap index dd466ec5..7e4ceb7f 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/OpportunityList.test.tsx.snap +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/__snapshots__/index.test.tsx.snap @@ -1,24 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[` should render 1`] = ` -.emotion-13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; -} - +exports[` should render 1`] = ` .emotion-12 { display: -webkit-box; display: -webkit-flex; @@ -108,7 +90,9 @@ exports[` should render 1`] = ` display: -webkit-flex; display: -ms-flexbox; display: flex; - sflex-direction: row; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; } .emotion-1 { @@ -208,85 +192,76 @@ exports[` should render 1`] = ` }
+ universityLogo +
+
- universityLogo +

-
- + 🇩🇪 + +

+

- Full Time | Munich, Germany - - 🇩🇪 - +

+ + + Apply Icon + + + +

- We are looking for a Python engineer to join our SEO team in Munich and drive organic user acquisition of Ignitus. + Apply

-
- - - Apply Icon - - - - -

- Apply -

-
diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.test.tsx index 8a3751af..aaa588e2 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Organisms/ignitus-OpportunityList/Components/index.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { mount, render } from 'enzyme'; import emotionSerializer, { matchers } from 'jest-emotion'; -import OpportunityList, { BtnWithIcon, Opportunity } from '.'; +import { BtnWithIcon, Opportunity } from './index'; import * as S from '../styles'; let wrapper; @@ -9,13 +9,13 @@ let wrapper; expect.addSnapshotSerializer(emotionSerializer); expect.extend(matchers); -describe('', () => { +describe('', () => { beforeEach(() => { - wrapper = mount(); + wrapper = mount(); }); it('should render', () => { - wrapper = render(); + wrapper = render(); expect(wrapper).toMatchSnapshot(); }); diff --git a/src/ignitus-UserInterfaceBook/Components/Layouts/interfaceSavedOpportunity/Components/index.tsx b/src/ignitus-UserInterfaceBook/Components/Layouts/interfaceSavedOpportunity/Components/index.tsx index 5ffa4dab..39b40b84 100644 --- a/src/ignitus-UserInterfaceBook/Components/Layouts/interfaceSavedOpportunity/Components/index.tsx +++ b/src/ignitus-UserInterfaceBook/Components/Layouts/interfaceSavedOpportunity/Components/index.tsx @@ -11,8 +11,8 @@ export const interfaceSavedOpportunity: React.FC = () => ( Opportunities Saved Layout
- {List.map(({ ...rest }: Opportunity, index) => ( - + {List.map(({ title, ...rest }: Opportunity) => ( + ))} diff --git a/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/Components/index.tsx b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/Components/index.tsx index 4b362632..48455e6f 100644 --- a/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/Components/index.tsx +++ b/src/ignitus-UserInterfaceBook/Components/Organisms/interfaceOpportunityList/Components/index.tsx @@ -4,7 +4,6 @@ import { Opportunity, Heading2 } from '../../../../../ignitus-Shared'; import { Interface } from '../../../../styles'; import { flexibleColDiv } from '../../../../../ignitus-Shared/ignitus-DesignSystem/shared'; import { OpportunityData } from '../constants'; -import { OpportunityDataType } from '../types'; export const OpportunityList = styled(flexibleColDiv)``; @@ -13,9 +12,9 @@ export const interfaceOpportunityList: React.FC = () => ( Opportunity List
- {OpportunityData.map(({ ...rest }, index) => ( - - + {OpportunityData.map(({ title, ...rest }) => ( + +
))} From 3834a2c0a4f9d3c57ec0cce7704e7979e42b4bb6 Mon Sep 17 00:00:00 2001 From: Dishebh Date: Thu, 21 May 2020 23:03:41 +0530 Subject: [PATCH 23/26] added test for scroll bar --- .../__snapshots__/index.test.tsx.snap | 41 +++++++++++++++++++ .../Components/index.test.tsx | 13 ++++++ 2 files changed, 54 insertions(+) create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/__snapshots__/index.test.tsx.snap create mode 100644 src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/index.test.tsx diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/__snapshots__/index.test.tsx.snap b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/__snapshots__/index.test.tsx.snap new file mode 100644 index 00000000..6b99257e --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/__snapshots__/index.test.tsx.snap @@ -0,0 +1,41 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render 1`] = ` +.emotion-1 { + margin: 30px; + float: left; + height: 300px; + width: 65px; + background: #f5f5f5; + overflow-y: scroll; + margin-bottom: 25px; +} + +.emotion-1::-webkit-scrollbar { + width: 12px; + background: #f5f5f5; +} + +.emotion-1::-webkit-scrollbar-track { + box-shadow: inset 0 0 6px rgba(0,0,0,0.3); + border-radius: 10px; + background-color: #f5f5f5; +} + +.emotion-1::-webkit-scrollbar-thumb { + border-radius: 10px; + background-color: #f90; +} + +.emotion-0 { + min-height: 450px; +} + +
+
+
+`; diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/index.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/index.test.tsx new file mode 100644 index 00000000..483779fa --- /dev/null +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ScrollBar/Components/index.test.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +import { render } from 'enzyme'; +import emotionSerializer from 'jest-emotion'; +import ScrollBar from './index'; + +expect.addSnapshotSerializer(emotionSerializer); + +describe('', () => { + it('should render', () => { + const wrapper = render(); + expect(wrapper).toMatchSnapshot(); + }); +}); From c9fb1f8f63401f6ad19408377e08f2b084c9bd8e Mon Sep 17 00:00:00 2001 From: Dishebh Date: Fri, 22 May 2020 15:24:21 +0530 Subject: [PATCH 24/26] added test for toggle categories on click --- .../Components/ToggleButtoninterface.test.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx index 8d17ae1f..4cbbedd2 100644 --- a/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx +++ b/src/ignitus-Shared/ignitus-DesignSystem/ignitus-Molecules/ignitus-ToggleButtons/Components/ToggleButtoninterface.test.tsx @@ -55,4 +55,22 @@ describe('', () => { wrapper.find(ButtonRight).simulate('click'); expect(props.handleClick).toHaveBeenCalledWith('right'); }); + + it('should toggle Button categories on click', () => { + wrapper.find(ButtonLeft).simulate('click'); + expect(wrapper.find(ButtonLeft).prop('category')).toBe( + props.activeCategory, + ); + expect(wrapper.find(ButtonRight).prop('category')).toBe( + props.inActiveCategory, + ); + + wrapper.find(ButtonRight).simulate('click'); + expect(wrapper.find(ButtonRight).prop('category')).toBe( + props.activeCategory, + ); + expect(wrapper.find(ButtonLeft).prop('category')).toBe( + props.inActiveCategory, + ); + }); }); From 1e036a26b413ad826390321c47e43cd46d107cc8 Mon Sep 17 00:00:00 2001 From: siddharth chauhan Date: Fri, 22 May 2020 20:35:32 +0530 Subject: [PATCH 25/26] fixed document typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c2ecc95b..149df33b 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ - [Redis](https://redislabs.com/) - Redis is an open source (BSD licensed), in-memory data structure store. -👋 Please refer our [doumentation](https://ignitus-docs.gitbook.io/ignitus/) to get insights on contributing & conventions guidelines. +👋 Please refer our [documentation](https://ignitus-docs.gitbook.io/ignitus/) to get insights on contributing & conventions guidelines.

From 14accc65ae9ae199a4e6fca851a04ec8a04e96c4 Mon Sep 17 00:00:00 2001 From: Divyanshu Rawat Date: Sun, 24 May 2020 12:15:54 +0200 Subject: [PATCH 26/26] =?UTF-8?q?Moved=20to=20devDependencies=20?= =?UTF-8?q?=F0=9F=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f6766f09..e514ce0b 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,7 @@ "dependencies": { "@emotion/core": "^10.0.22", "@emotion/styled": "^10.0.23", - "@types/react": "16.9.23", "axios": "^0.18.0", - "eslint-config-prettier": "6.11.0", - "eslint-plugin-prettier": "3.1.3", "idb": "^4.0.3", "react": "^16.8.6", "react-dom": "^16.8.6", @@ -28,8 +25,7 @@ "redux": "^4.0.1", "redux-logger": "^3.0.6", "redux-saga": "^0.16.0", - "reselect": "^4.0.0", - "typescript": "^3.1.6" + "reselect": "^4.0.0" }, "scripts": { "start": "react-scripts start", @@ -47,6 +43,7 @@ "@types/jest": "^25.1.3", "@types/node": "^13.7.4", "@types/react-dom": "^16.8.2", + "@types/react": "16.9.23", "@types/react-redux": "^7.1.7", "@types/react-router-dom": "5.1.3", "@types/redux-logger": "3.0.7", @@ -69,7 +66,10 @@ "jest-emotion": "10.0.32", "jest-localstorage-mock": "^2.2.0", "prettier": "1.17.0", - "sw-precache": "^5.2.1" + "sw-precache": "^5.2.1", + "eslint-config-prettier": "6.11.0", + "eslint-plugin-prettier": "3.1.3", + "typescript": "^3.1.6" }, "jest": { "collectCoverageFrom": [