Skip to content

Commit

Permalink
WIP: Update Home tests after apollo implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
rkclark committed Jul 9, 2018
1 parent 1c82bca commit ad9149b
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 150 deletions.
1 change: 1 addition & 0 deletions .jestrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"\\.(gql|graphql)$": "jest-transform-graphql",
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
"^(?!.*\\.(js|jsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
Expand Down
6 changes: 6 additions & 0 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ module.exports = {
/\.gif$/,
/\.jpe?g$/,
/\.png$/,
/\.graphql$/,
],
loader: require.resolve('file-loader'),
options: {
Expand Down Expand Up @@ -250,6 +251,11 @@ module.exports = {
},
],
},
{
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
loader: 'graphql-tag/loader',
},
// ** STOP ** Are you adding a new loader?
// Remember to add the new extension(s) to the "file" loader exclusion list.
],
Expand Down
6 changes: 6 additions & 0 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ module.exports = {
/\.gif$/,
/\.jpe?g$/,
/\.png$/,
/\.graphql$/,
],
loader: require.resolve('file-loader'),
options: {
Expand Down Expand Up @@ -267,6 +268,11 @@ module.exports = {
),
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
{
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
loader: 'graphql-tag/loader',
},
// ** STOP ** Are you adding a new loader?
// Remember to add the new extension(s) to the "file" loader exclusion list.
],
Expand Down
122 changes: 67 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"husky": "^0.14.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^22.4.4",
"jest-transform-graphql": "^2.1.0",
"nodemon": "^1.17.5",
"npm-run-all": "^4.1.3",
"object-assign": "4.1.1",
Expand All @@ -110,6 +111,7 @@
"supertest": "^3.0.0",
"sw-precache-webpack-plugin": "0.9.1",
"url-loader": "^0.5.8",
"waait": "^1.0.2",
"webpack": "2.6.1",
"webpack-dev-server": "2.4.5",
"webpack-manifest-plugin": "1.1.0",
Expand Down
56 changes: 56 additions & 0 deletions src/queries/reposWithPullRequests.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
query pullRequests($ids: [ID!]!, $maximumPrs: Int!) {
nodes(ids: $ids) {
id
... on Repository {
pullRequests(
last: $maximumPrs
states: [OPEN]
orderBy: { field: CREATED_AT, direction: DESC }
) {
totalCount
edges {
node {
createdAt
url
number
title
author {
avatarUrl
login
url
}
reviewRequests(last: 100) {
edges {
node {
requestedReviewer {
... on User {
login
avatarUrl
}
... on Team {
name
id
avatarUrl
}
}
}
}
}
reviews(last: 100) {
edges {
node {
author {
login
avatarUrl
}
createdAt
state
}
}
}
}
}
}
}
}
}
Loading

0 comments on commit ad9149b

Please sign in to comment.