Skip to content

Commit 2e100ef

Browse files
authored
Merge pull request #279 from manosim/pr/273
Support GitHub Enterprise
2 parents 4865151 + 1183330 commit 2e100ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2841
-1101
lines changed

.vscode/launch.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
// Use IntelliSense to learn about possible Node.js debug attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"program": "${workspaceRoot}/main.js"
12+
},
13+
{
14+
"type": "node",
15+
"request": "attach",
16+
"name": "Attach to Process",
17+
"address": "localhost",
18+
"port": 5858
19+
}
20+
]
21+
}

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"dependencies": {
5959
"auto-launch": "=5.0.1",
6060
"axios": "=0.16.1",
61-
"bootstrap": "=4.0.0-alpha.5",
61+
"bootstrap": "=4.0.0-alpha.6",
6262
"electron-gh-releases": "=2.0.4",
6363
"font-awesome": "=4.7.0",
6464
"icheck": "=1.0.2",
@@ -67,27 +67,28 @@
6767
"moment": "=2.18.1",
6868
"nprogress": "=0.2.0",
6969
"octicons": "=4.4.0",
70+
"prop-types": "=15.5.10",
7071
"react": "=15.5.4",
7172
"react-addons-css-transition-group": "=15.5.2",
7273
"react-addons-shallow-compare": "=15.5.2",
7374
"react-addons-test-utils": "=15.5.1",
7475
"react-dom": "=15.5.4",
7576
"react-emojione": "=2.0.0",
76-
"react-icheck": "=0.3.7",
77-
"react-modal": "=1.7.3",
77+
"react-icheck": "=0.3.8",
78+
"react-modal": "=1.7.7",
7879
"react-redux": "=5.0.4",
79-
"react-router": "=4.1.0",
80-
"react-router-dom": "=4.1.0",
80+
"react-router": "=4.1.1",
81+
"react-router-dom": "=4.1.1",
8182
"redux": "=3.6.0",
83+
"redux-form": "=6.6.3",
8284
"redux-storage": "=4.1.2",
8385
"redux-storage-decorator-filter": "=1.1.8",
8486
"redux-storage-engine-localstorage": "=1.1.4",
8587
"redux-storage-merger-immutablejs": "=1.0.5",
86-
"redux-thunk": "=2.2.0",
87-
"underscore": "=1.8.3"
88+
"redux-thunk": "=2.2.0"
8889
},
8990
"devDependencies": {
90-
"babel-eslint": "=7.2.1",
91+
"babel-eslint": "=7.2.3",
9192
"babel-jest": "=19.0.0",
9293
"babel-preset-es2015": "=6.24.1",
9394
"babel-preset-react": "=6.24.1",
@@ -96,7 +97,7 @@
9697
"browserify": "=14.3.0",
9798
"electron": "=1.6.2",
9899
"electron-packager": "=8.6.0",
99-
"enzyme": "=2.8.1",
100+
"enzyme": "=2.8.2",
100101
"eslint": "=3.19.0",
101102
"eslint-plugin-react": "=6.10.3",
102103
"gulp": "=3.9.1",

src/js/__mocks__/electron.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ const browserWindow = {
3535
destroy: jest.fn()
3636
};
3737

38+
const dialog = {
39+
showErrorBox: jest.fn(),
40+
};
41+
3842
module.exports = {
3943
remote: {
40-
BrowserWindow: () => browserWindow
44+
BrowserWindow: () => browserWindow,
45+
dialog: dialog,
4146
},
4247
ipcRenderer: {
4348
send: jest.fn(),

src/js/__mocks__/mockedData.js

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
import { fromJS } from 'immutable';
2+
3+
export const mockedEnterpriseAccounts = fromJS([
4+
{
5+
hostname: 'github.gitify.io',
6+
token: '1234568790',
7+
},
8+
]);
9+
10+
// 2 Notifications
11+
// Repository : 'manosim/notifications-tests'
12+
export const mockedGithubNotifications = fromJS([
13+
{
14+
'id': '138661096',
15+
'unread': true,
16+
'reason': 'subscribed',
17+
'updated_at': '2017-05-20T17:51:57Z',
18+
'last_read_at': '2017-05-20T17:06:51Z',
19+
'subject': {
20+
'title': 'I am a robot and this is a test!',
21+
'url': 'https://api.github.com/repos/manosim/notifications-test/issues/1',
22+
'latest_comment_url': 'https://api.github.com/repos/manosim/notifications-test/issues/comments/302888448',
23+
'type': 'Issue'
24+
},
25+
'repository': {
26+
'id': 57216596,
27+
'name': 'notifications-test',
28+
'full_name': 'manosim/notifications-test',
29+
'owner': {
30+
'login': 'manosim',
31+
'id': 6333409,
32+
'avatar_url': 'https://avatars0.githubusercontent.com/u/6333409?v=3',
33+
'gravatar_id': '',
34+
'url': 'https://api.github.com/users/manosim',
35+
'html_url': 'https://github.com/manosim',
36+
'followers_url': 'https://api.github.com/users/manosim/followers',
37+
'following_url': 'https://api.github.com/users/manosim/following{/other_user}',
38+
'gists_url': 'https://api.github.com/users/manosim/gists{/gist_id}',
39+
'starred_url': 'https://api.github.com/users/manosim/starred{/owner}{/repo}',
40+
'subscriptions_url': 'https://api.github.com/users/manosim/subscriptions',
41+
'organizations_url': 'https://api.github.com/users/manosim/orgs',
42+
'repos_url': 'https://api.github.com/users/manosim/repos',
43+
'events_url': 'https://api.github.com/users/manosim/events{/privacy}',
44+
'received_events_url': 'https://api.github.com/users/manosim/received_events',
45+
'type': 'User',
46+
'site_admin': false
47+
},
48+
'private': true,
49+
'html_url': 'https://github.com/manosim/notifications-test',
50+
'description': null,
51+
'fork': false,
52+
// Removed the rest of the properties
53+
},
54+
'url': 'https://api.github.com/notifications/threads/138661096',
55+
'subscription_url': 'https://api.github.com/notifications/threads/138661096/subscription'
56+
},
57+
{
58+
'id': '148827438',
59+
'unread': true,
60+
'reason': 'author',
61+
'updated_at': '2017-05-20T17:06:34Z',
62+
'last_read_at': '2017-05-20T16:59:03Z',
63+
'subject': {
64+
'title': 'Improve the UI',
65+
'url': 'https://api.github.com/repos/manosim/notifications-test/issues/4',
66+
'latest_comment_url': 'https://api.github.com/repos/manosim/notifications-test/issues/comments/302885965',
67+
'type': 'Issue'
68+
},
69+
'repository': {
70+
'id': 57216596,
71+
'name': 'notifications-test',
72+
'full_name': 'manosim/notifications-test',
73+
'owner': {
74+
'login': 'manosim',
75+
'id': 6333409,
76+
'avatar_url': 'https://avatars0.githubusercontent.com/u/6333409?v=3',
77+
'gravatar_id': '',
78+
'url': 'https://api.github.com/users/manosim',
79+
'html_url': 'https://github.com/manosim',
80+
'followers_url': 'https://api.github.com/users/manosim/followers',
81+
'following_url': 'https://api.github.com/users/manosim/following{/other_user}',
82+
'gists_url': 'https://api.github.com/users/manosim/gists{/gist_id}',
83+
'starred_url': 'https://api.github.com/users/manosim/starred{/owner}{/repo}',
84+
'subscriptions_url': 'https://api.github.com/users/manosim/subscriptions',
85+
'organizations_url': 'https://api.github.com/users/manosim/orgs',
86+
'repos_url': 'https://api.github.com/users/manosim/repos',
87+
'events_url': 'https://api.github.com/users/manosim/events{/privacy}',
88+
'received_events_url': 'https://api.github.com/users/manosim/received_events',
89+
'type': 'User',
90+
'site_admin': false
91+
},
92+
'private': true,
93+
'html_url': 'https://github.com/manosim/notifications-test',
94+
'description': null,
95+
'fork': false,
96+
// Removed the rest of the properties
97+
},
98+
'url': 'https://api.github.com/notifications/threads/148827438',
99+
'subscription_url': 'https://api.github.com/notifications/threads/148827438/subscription'
100+
}
101+
]);
102+
103+
104+
// 2 Notifications
105+
// Repository : 'myorg/notifications-test'
106+
export const mockedEnterpriseNotifications = fromJS([
107+
{
108+
'id': '4',
109+
'unread': true,
110+
'reason': 'subscribed',
111+
'updated_at': '2017-05-20T13:02:48Z',
112+
'last_read_at': null,
113+
'subject': {
114+
'title': 'Release 0.0.1',
115+
'url': 'https://github.gitify.io/api/v3/repos/myorg/notifications-test/releases/1',
116+
'latest_comment_url': 'https://github.gitify.io/api/v3/repos/myorg/notifications-test/releases/1',
117+
'type': 'Release'
118+
},
119+
'repository': {
120+
'id': 1,
121+
'name': 'notifications-test',
122+
'full_name': 'myorg/notifications-test',
123+
'owner': {
124+
'login': 'myorg',
125+
'id': 4,
126+
'avatar_url': 'https://github.gitify.io/avatars/u/4?',
127+
'gravatar_id': '',
128+
'url': 'https://github.gitify.io/api/v3/users/myorg',
129+
'html_url': 'https://github.gitify.io/myorg',
130+
'followers_url': 'https://github.gitify.io/api/v3/users/myorg/followers',
131+
'following_url': 'https://github.gitify.io/api/v3/users/myorg/following{/other_user}',
132+
'gists_url': 'https://github.gitify.io/api/v3/users/myorg/gists{/gist_id}',
133+
'starred_url': 'https://github.gitify.io/api/v3/users/myorg/starred{/owner}{/repo}',
134+
'subscriptions_url': 'https://github.gitify.io/api/v3/users/myorg/subscriptions',
135+
'organizations_url': 'https://github.gitify.io/api/v3/users/myorg/orgs',
136+
'repos_url': 'https://github.gitify.io/api/v3/users/myorg/repos',
137+
'events_url': 'https://github.gitify.io/api/v3/users/myorg/events{/privacy}',
138+
'received_events_url': 'https://github.gitify.io/api/v3/users/myorg/received_events',
139+
'type': 'Organization',
140+
'site_admin': false
141+
},
142+
'private': true,
143+
'html_url': 'https://github.gitify.io/myorg/notifications-test',
144+
'description': null,
145+
'fork': false,
146+
// Removed the rest of the properties
147+
},
148+
'url': 'https://github.gitify.io/api/v3/notifications/threads/4',
149+
'subscription_url': 'https://github.gitify.io/api/v3/notifications/threads/4/subscription'
150+
},
151+
{
152+
'id': '3',
153+
'unread': true,
154+
'reason': 'subscribed',
155+
'updated_at': '2017-05-20T15:52:20Z',
156+
'last_read_at': '2017-05-20T14:20:55Z',
157+
'subject': {
158+
'title': 'Bump Version',
159+
'url': 'https://github.gitify.io/api/v3/repos/myorg/notifications-test/pulls/3',
160+
'latest_comment_url': 'https://github.gitify.io/api/v3/repos/myorg/notifications-test/issues/comments/21',
161+
'type': 'PullRequest'
162+
},
163+
'repository': {
164+
'id': 1,
165+
'name': 'notifications-test',
166+
'full_name': 'myorg/notifications-test',
167+
'owner': {
168+
'login': 'myorg',
169+
'id': 4,
170+
'avatar_url': 'https://github.gitify.io/avatars/u/4?',
171+
'gravatar_id': '',
172+
'url': 'https://github.gitify.io/api/v3/users/myorg',
173+
'html_url': 'https://github.gitify.io/myorg',
174+
'followers_url': 'https://github.gitify.io/api/v3/users/myorg/followers',
175+
'following_url': 'https://github.gitify.io/api/v3/users/myorg/following{/other_user}',
176+
'gists_url': 'https://github.gitify.io/api/v3/users/myorg/gists{/gist_id}',
177+
'starred_url': 'https://github.gitify.io/api/v3/users/myorg/starred{/owner}{/repo}',
178+
'subscriptions_url': 'https://github.gitify.io/api/v3/users/myorg/subscriptions',
179+
'organizations_url': 'https://github.gitify.io/api/v3/users/myorg/orgs',
180+
'repos_url': 'https://github.gitify.io/api/v3/users/myorg/repos',
181+
'events_url': 'https://github.gitify.io/api/v3/users/myorg/events{/privacy}',
182+
'received_events_url': 'https://github.gitify.io/api/v3/users/myorg/received_events',
183+
'type': 'Organization',
184+
'site_admin': false
185+
},
186+
'private': true,
187+
'html_url': 'https://github.gitify.io/myorg/notifications-test',
188+
'description': null,
189+
'fork': false,
190+
// Removed the rest of the properties
191+
},
192+
'url': 'https://github.gitify.io/api/v3/notifications/threads/3',
193+
'subscription_url': 'https://github.gitify.io/api/v3/notifications/threads/3/subscription'
194+
}
195+
]);
196+
197+
export const mockedNotificationsRecuderData = fromJS([
198+
{
199+
hostname: 'github.com',
200+
notifications: mockedGithubNotifications,
201+
},
202+
{
203+
hostname: 'github.gitify.io',
204+
notifications: mockedEnterpriseNotifications,
205+
},
206+
]);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`app.js should render the Not Found component 1`] = `
4+
<h2>
5+
Not found
6+
</h2>
7+
`;
8+
9+
exports[`app.js should test the PrivateRoute component (authenticated) 1`] = `null`;
10+
11+
exports[`app.js should test the PrivateRoute component (non authenticated) 1`] = `null`;

0 commit comments

Comments
 (0)