Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
130a2f2
remove fetch json in auth folder
Aug 28, 2018
1b65e66
add immutable to login and remove type class error
Aug 28, 2018
0abb9e9
add type ReactTestRenderer and done to async test fetchJSON
Aug 28, 2018
32f3bba
remove fetch json in auth folder
Aug 28, 2018
4b1befa
add immutable to login and remove type class error
Aug 28, 2018
229d062
add type ReactTestRenderer and done to async test fetchJSON
Aug 28, 2018
ccf6be2
remove fetch json in auth folder
Aug 28, 2018
694914a
add immutable to login and remove type class error
Aug 28, 2018
8c1d875
add type ReactTestRenderer and done to async test fetchJSON
Aug 28, 2018
df60cde
remove fetch json in auth folder
Aug 28, 2018
f193b6b
add immutable to login and remove type class error
Aug 28, 2018
52e30fa
add type ReactTestRenderer and done to async test fetchJSON
Aug 28, 2018
5aba18b
remove fetch json in auth folder
Aug 28, 2018
f076a86
add immutable to login and remove type class error
Aug 28, 2018
bbeb90b
add type ReactTestRenderer and done to async test fetchJSON
Aug 28, 2018
079e819
remove fetch json in auth folder
Aug 28, 2018
4034641
add immutable to login and remove type class error
Aug 28, 2018
3c9cc54
add type ReactTestRenderer and done to async test fetchJSON
Aug 28, 2018
a2667b3
remove fetch json in auth folder
Aug 28, 2018
331799c
add immutable to login and remove type class error
Aug 28, 2018
4aa8839
add type ReactTestRenderer and done to async test fetchJSON
Aug 28, 2018
24aa7c5
remove fetch json in auth folder
Aug 28, 2018
62ce8f3
add immutable to login and remove type class error
Aug 28, 2018
072f49b
add type ReactTestRenderer and done to async test fetchJSON
Aug 28, 2018
3c66c8d
edit filelist key to be unique
Aug 30, 2018
12821c4
Making Test
Aug 31, 2018
6697eda
add yarn lock to stage again?
Sep 3, 2018
8883579
Merge branch 'bootcamp-6' into testMaker
ajilantang Sep 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ npm-debug.log*
package-lock.json
yarn-debug.log*
yarn-error.log*

30 changes: 30 additions & 0 deletions src/components/EventCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ function EventCard(props: EventCardProps) {
);
}

function renderIconAction(action: string) {
switch (action) {
case 'COMMENT_PR':
return (
<Icon
name="comment-discussion"
size={24}
color="grey"
type="OCTICONS"
/>
);
case 'COMMENT_ISSUE':
return (
<Icon
name="comment-discussion"
size={24}
color="grey"
type="OCTICONS"
/>
);
case 'PR':
return (
<Icon name="git-pull-request" size={24} color="grey" type="OCTICONS" />
);
case 'ISSUE':
return (
<Icon name="issue-opened" size={24} color="grey" type="OCTICONS" />
);
case 'FORK':
return <Icon name="repo-forked" size={24} color="grey" type="OCTICONS" />;
export function renderIconType(event: Event) {
let type: string = event.type;
if (event.type === 'IssuesEvent') {
Expand Down
6 changes: 2 additions & 4 deletions src/components/Repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {FontAwesome, Octicons, Entypo} from '@expo/vector-icons';
import {DARK_GREY} from '../global/constants/colors';
import languageColor from '../global/constants/languageColor';

type Repo = {
export type Repo = {
description: string;
fork: boolean;
forks: number;
Expand All @@ -31,13 +31,11 @@ function repoComponent(props: Repo) {
: null;
langColor = langColor ? langColor : '#000000';
let langView = () => {
return language ? (
return (
<View style={styles.logoAndText}>
<FontAwesome name="circle" color={langColor} style={{marginRight: 2}} />
<Text>{language}</Text>
</View>
) : (
<View style={styles.logoAndText} />
);
};
return (
Expand Down
58 changes: 58 additions & 0 deletions src/components/__tests__/Repo.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// @flow
import React from 'react';
import renderer from 'react-test-renderer';
import repoComponent from '../Repo';

describe('Button', () => {
let data = [
{
description: 'a',
fork: true,
forks: 1,
link: () => true,
id: 232343,
language: 'JavaScript',
name: 'asdfew',
stargazersCount: 2,
},
{
description: 'a',
fork: true,
forks: 1,
link: () => true,
id: 232343,
language: '---',
name: 'asdfew',
stargazersCount: 2,
},
{
description: 'a',
fork: false,
forks: 1,
link: () => true,
id: 232343,
language: 'Apex',
name: 'asdfew',
stargazersCount: 2,
},
];

it('should render Button corectly', () => {
let repo = repoComponent(data[0]);
let component = renderer.create(repo);
let tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('should render with wrong language', () => {
let repo = repoComponent(data[1]);
let component = renderer.create(repo);
let tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('should render with null langColor', () => {
let repo = repoComponent(data[2]);
let component = renderer.create(repo);
let tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ exports[`EventCard should render EventCard with comment correctly 1`] = `
"flexDirection": "row",
"justifyContent": "center",
},
Array [],
Object {},
]
}
>
Expand Down
Loading