Skip to content

Commit

Permalink
Merge pull request #850 from Ignitus/develop
Browse files Browse the repository at this point in the history
Master > Develop
  • Loading branch information
divyanshu-rawat authored Jun 13, 2020
2 parents 7dfe7e7 + 23607ba commit 86d51a1
Show file tree
Hide file tree
Showing 223 changed files with 2,174 additions and 764 deletions.
2 changes: 1 addition & 1 deletion src/App.test.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import {App} from './App';

it('renders without crashing', () => {
const div = document.createElement('div');
Expand Down
6 changes: 2 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ const Root = styled.div`
background: ${GreyBackground};
`;

const App = () => (
export const App = withErrorBoundary(() => (
<Root>
<Switch>
<Route path="/dashboard" component={DashboardRoutes} />
<Route path="/interface" component={UserInterfaceBookRoutes} />
<Route path="/" component={PublicRoutes} />
</Switch>
</Root>
);

export default withErrorBoundary(App);
));

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions src/ignitus-AboutPage/ignitus-CoreTeam/Components/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react';
import { render, mount } from 'enzyme';
import { CoreTeam } from './index';
import { Data } from '../constants';

React.useLayoutEffect = React.useEffect;

let wrapper;
beforeEach(() => {
wrapper = mount(<CoreTeam />);
});

describe('<CoreTeam />', () => {
it('should be rendered', () => {
const tree = render(wrapper);
expect(tree).toMatchSnapshot();
});

it('should render correct title', () => {
expect(wrapper.find('h2').text()).toBe(' Our Team ');
});

it('should render correct core team data correctly', () => {
expect(wrapper.find('TeamItem').length).toBe(Data.length);
Data.forEach((val: any, index: number) => {
expect(
wrapper
.find('TeamItem')
.at(index)
.props().item === val,
);
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<Team /> should be rendered 1`] = `
<div
class="css-1hs3667"
>
<div
class="css-1uzyx05"
>
<div
class="css-1hs3667"
>
<h2
class="css-lcriaz"
>
<svg
aria-label="Plus Icon"
class="css-1p4zvgu"
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<title>
Plus Icon
</title>
<path
d="M0 0h24v24H0V0z"
fill="none"
/>
<path
d="M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"
/>
</svg>
1 Contributors
</h2>
<p
class="css-gvbdwp"
>
This project was made possible by these contributors. 🎉 🎨
</p>
</div>
<div
class="css-1guir8e"
>
<div
class="css-16kcklx"
>
<a
class="css-861jbu"
href="https://github.com/octocat"
rel="noopener noreferrer"
target="_blank"
>
<img
alt="avatar octocat"
class="css-a07s8t"
src="https://github.com/images/error/octocat_happy.gif"
width="100%"
/>
</a>
</div>
<a
class="css-jgl6n1"
href="https://github.com/Ignitus/Ignitus-client/graphs/contributors"
>
View All
<svg
aria-hidden="true"
aria-label="KeyBoardArrowDown"
class="css-1p4zvgu"
data-icon="KeyBoardArrowDown"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<title>
KeyBoardArrowDown
</title>
<path
d="M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"
/>
</svg>
</a>
</div>
</div>
</div>
`;
65 changes: 65 additions & 0 deletions src/ignitus-AboutPage/ignitus-Team/Components/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React from 'react';
import { render, mount } from 'enzyme';
import { Team } from './index';
import { GitHubDataType } from '../types';

React.useLayoutEffect = React.useEffect;
/*eslint-disable*/
const octocatGithubData: GitHubDataType = {
login: 'octocat',
id: 1,
node_id: 'MDQ6VXNlcjE=',
avatar_url: 'https://github.com/images/error/octocat_happy.gif',
gravatar_id: '',
url: 'https://api.github.com/users/octocat',
html_url: 'https://github.com/octocat',
followers_url: 'https://api.github.com/users/octocat/followers',
following_url: 'https://api.github.com/users/octocat/following{/other_user}',
gists_url: 'https://api.github.com/users/octocat/gists{/gist_id}',
starred_url: 'https://api.github.com/users/octocat/starred{/owner}{/repo}',
subscriptions_url: 'https://api.github.com/users/octocat/subscriptions',
organizations_url: 'https://api.github.com/users/octocat/orgs',
repos_url: 'https://api.github.com/users/octocat/repos',
events_url: 'https://api.github.com/users/octocat/events{/privacy}',
received_events_url: 'https://api.github.com/users/octocat/received_events',
type: 'User',
site_admin: false,
contributions: 1000,
user_id: 1234,
};
/* eslint-enable */

let wrapper;
const props: any = {
getContributorsData() {
return [];
},
contributorsData: {
presets: [octocatGithubData],
isFetching: false,
},
};
beforeEach(() => {
wrapper = mount(<Team {...props} />);
});

describe('<Team />', () => {
it('should be rendered', () => {
const tree = render(wrapper);
expect(tree).toMatchSnapshot();
});

it('should render correct title', () => {
expect(wrapper.find('h2').text()).toBe('Plus Icon1 Contributors');
});

it('shoud render contributors data correctly', () => {
expect(wrapper.find('PureTeam').length).toBe(1);
expect(
wrapper
.find('PureTeam')
.at(0)
.props('contributors') === octocatGithubData,
);
});
});
2 changes: 1 addition & 1 deletion src/ignitus-AboutPage/ignitus-Team/Styles/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';

import { Paragraph, Loading, Normal } from '../../../ignitus-Shared';
import { default as I } from '../../../ignitus-Shared/ignitus-Utilities/Components/icon';
import { Icon as I } from '../../../ignitus-Shared/ignitus-Utilities/Components/icon';

import * as T from '../../../ignitus-Shared/ignitus-DesignSystem/shared';
import * as C from '../../../ignitus-Shared/ignitus-DesignSystem/ignitus-Atoms/colors';
Expand Down
1 change: 1 addition & 0 deletions src/ignitus-AboutPage/ignitus-Team/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { TeamActionType } from './types';

export const getContributorsData = (): TeamActionType => ({
type: t.GET_CONTRIBUTORS_DATA,
data: [],
});
2 changes: 1 addition & 1 deletion src/ignitus-AboutPage/ignitus-Team/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as actions from './actions';
import * as constants from './constants';
import * as containers from './Containers';
import reducer from './reducers';
import { contributorsReducer as reducer } from './reducers';
import * as sagas from './sagas';
import * as selectors from './selectors';

Expand Down
4 changes: 1 addition & 3 deletions src/ignitus-AboutPage/ignitus-Team/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function getContributorsData() {
return { isFetching: true, presets: [] };
}

const contributorsReducer = (
export const contributorsReducer = (
state = initialState,
action: TeamActionType,
): TeamReducerReturnType => {
Expand All @@ -24,5 +24,3 @@ const contributorsReducer = (
return state;
}
};

export default contributorsReducer;
6 changes: 3 additions & 3 deletions src/ignitus-AboutPage/ignitus-Team/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable camelcase */
export type TeamActionType = {
type: string;
data?: any;
data: GitHubDataType[];
};

export type GitHubDataType = {
export interface GitHubDataType {
login: string;
id: number;
node_id: string;
Expand All @@ -25,7 +25,7 @@ export type GitHubDataType = {
site_admin: false;
contributions: number;
user_id: number;
};
}

export type TeamReducerReturnType = {
presets: GitHubDataType[];
Expand Down
2 changes: 1 addition & 1 deletion src/ignitus-Api/dbhelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function getDataFromDB(storeName) {
}
}

export async function getItemFromDB(storeName, key) {
export async function getItemFromDB(storeName, key: string) {
try {
const db: any = await createDB;
const tx = db.transaction(storeName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';

import ProfessorLogin from '../../ignitus-ProfessorLogin/Components';
import { Login as ProfessorLogin } from '../../ignitus-ProfessorLogin/Components';
import { mapDispatchToProps, mapStateToProps } from './utils';

export default connect(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';

import StudentLogin from '../../ignitus-StudentLogin/Components';
import { Login as StudentLogin } from '../../ignitus-StudentLogin/Components';
import { mapDispatchToProps, mapStateToProps } from './utils';

export default connect(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import reducer from './reducer';
import { loginReducer as reducer } from './reducer';
import * as sagas from './sagas';
import * as actions from './actions';
import * as constants from './constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const RESET = {
success: false,
};

const loginReducer = (
export const loginReducer = (
state = { isFetching: false, message: '', success: false },
action,
) => {
Expand All @@ -33,5 +33,3 @@ const loginReducer = (
return state;
}
};

export default loginReducer;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';

import { default as ProfessorSignUp } from '../../ignitus-ProfessorSignUp/Components';
import { SignUp as ProfessorSignUp } from '../../ignitus-ProfessorSignUp/Components';

import { mapStateToProps, mapDispatchToProps } from './utils';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';

import { default as StudentSignUp } from '../../ignitus-StudentSignUpFlow/ignitus-StudentSignUp/Components';
import { Signup as StudentSignUp } from '../../ignitus-StudentSignUpFlow/ignitus-StudentSignUp/Components';

import { mapStateToProps, mapDispatchToProps } from './utils';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import reducer from './reducers';
import { signUpReducer as reducer } from './reducers';
import * as sagas from './sagas';
import * as actions from './actions';
import * as constants from './constants';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as t from './actionTypes';

const signUpReducer = (state = {}, action) => {
export const signUpReducer = (state = {}, action) => {
switch (action.type) {
case t.SIGN_UP_RESPONSE:
return { ...state, isFetching: false, ...action.data };
Expand All @@ -20,5 +20,3 @@ const signUpReducer = (state = {}, action) => {
return state;
}
};

export default signUpReducer;
Loading

0 comments on commit 86d51a1

Please sign in to comment.