From 559ed393a9a4b7d819a9bf0e7cfc6a3328de6a92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dandelion=20Man=C3=A9?=
Date: Tue, 20 Mar 2018 13:18:38 -0700
Subject: [PATCH] Update example-repo json and snapshots (#95)
I added some new issues to sourcecred/example-repo to test unicode
support and parsing of extremely long issues titles.
This commit merely updates our example-repo json and the corresponding
snapshots.
Test plan:
Run testFetchGithubRepo.sh
Run unit tests
---
.../__snapshots__/githubPlugin.test.js.snap | 41 +++++++++++++++++++
src/plugins/github/demoData/example-repo.json | 36 ++++++++++++++++
2 files changed, 77 insertions(+)
diff --git a/src/plugins/github/__snapshots__/githubPlugin.test.js.snap b/src/plugins/github/__snapshots__/githubPlugin.test.js.snap
index af4593a..a6eed37 100644
--- a/src/plugins/github/__snapshots__/githubPlugin.test.js.snap
+++ b/src/plugins/github/__snapshots__/githubPlugin.test.js.snap
@@ -483,6 +483,32 @@ Object {
"repositoryName": "sourcecred/example-repo",
},
},
+ "{\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"id\\":\\"{\\\\\\"authorID\\\\\\":{\\\\\\"id\\\\\\":\\\\\\"MDQ6VXNlcjE0MDAwMjM=\\\\\\",\\\\\\"type\\\\\\":\\\\\\"USER\\\\\\"},\\\\\\"contributionID\\\\\\":{\\\\\\"id\\\\\\":\\\\\\"MDU6SXNzdWUzMDY5ODM1NTI=\\\\\\",\\\\\\"type\\\\\\":\\\\\\"ISSUE\\\\\\"},\\\\\\"type\\\\\\":\\\\\\"AUTHORSHIP\\\\\\"}\\"}": Object {
+ "dst": Object {
+ "id": "{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"type\\":\\"USER\\"}",
+ "pluginName": "sourcecred/github-beta",
+ "repositoryName": "sourcecred/example-repo",
+ },
+ "payload": Object {},
+ "src": Object {
+ "id": "{\\"id\\":\\"MDU6SXNzdWUzMDY5ODM1NTI=\\",\\"type\\":\\"ISSUE\\"}",
+ "pluginName": "sourcecred/github-beta",
+ "repositoryName": "sourcecred/example-repo",
+ },
+ },
+ "{\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"id\\":\\"{\\\\\\"authorID\\\\\\":{\\\\\\"id\\\\\\":\\\\\\"MDQ6VXNlcjE0MDAwMjM=\\\\\\",\\\\\\"type\\\\\\":\\\\\\"USER\\\\\\"},\\\\\\"contributionID\\\\\\":{\\\\\\"id\\\\\\":\\\\\\"MDU6SXNzdWUzMDY5ODUzNjc=\\\\\\",\\\\\\"type\\\\\\":\\\\\\"ISSUE\\\\\\"},\\\\\\"type\\\\\\":\\\\\\"AUTHORSHIP\\\\\\"}\\"}": Object {
+ "dst": Object {
+ "id": "{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"type\\":\\"USER\\"}",
+ "pluginName": "sourcecred/github-beta",
+ "repositoryName": "sourcecred/example-repo",
+ },
+ "payload": Object {},
+ "src": Object {
+ "id": "{\\"id\\":\\"MDU6SXNzdWUzMDY5ODUzNjc=\\",\\"type\\":\\"ISSUE\\"}",
+ "pluginName": "sourcecred/github-beta",
+ "repositoryName": "sourcecred/example-repo",
+ },
+ },
"{\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"id\\":\\"{\\\\\\"authorID\\\\\\":{\\\\\\"id\\\\\\":\\\\\\"MDQ6VXNlcjQzMTc4MDY=\\\\\\",\\\\\\"type\\\\\\":\\\\\\"USER\\\\\\"},\\\\\\"contributionID\\\\\\":{\\\\\\"id\\\\\\":\\\\\\"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3MTAwMzE0MDM4\\\\\\",\\\\\\"type\\\\\\":\\\\\\"PULL_REQUEST_REVIEW\\\\\\"},\\\\\\"type\\\\\\":\\\\\\"AUTHORSHIP\\\\\\"}\\"}": Object {
"dst": Object {
"id": "{\\"id\\":\\"MDQ6VXNlcjQzMTc4MDY=\\",\\"type\\":\\"USER\\"}",
@@ -733,6 +759,21 @@ https://github.com/sourcecred/example-repo/issues/6#issuecomment-373768538",
"title": "An issue with comments",
},
},
+ "{\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"id\\":\\"{\\\\\\"id\\\\\\":\\\\\\"MDU6SXNzdWUzMDY5ODM1NTI=\\\\\\",\\\\\\"type\\\\\\":\\\\\\"ISSUE\\\\\\"}\\"}": Object {
+ "payload": Object {
+ "body": "Deal with this, naive string display algorithms!!!!!",
+ "number": 7,
+ "title": "An issue with an extremely long title, which even has a VerySuperFragicalisticialiManyCharacterUberLongTriplePlusGood word in it, and should really be truncated intelligently or something",
+ },
+ },
+ "{\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"id\\":\\"{\\\\\\"id\\\\\\":\\\\\\"MDU6SXNzdWUzMDY5ODUzNjc=\\\\\\",\\\\\\"type\\\\\\":\\\\\\"ISSUE\\\\\\"}\\"}": Object {
+ "payload": Object {
+ "body": "Issue with Unicode: ศดแฒ๐ฃณๆฅข๐ :heart: ๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค โค๏ธ
+Issue with Unicode: ศดแฒ๐ฃณๆฅข๐ :heart: ๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค โค๏ธ",
+ "number": 8,
+ "title": "Issue with Unicode: ศดแฒ๐ฃณๆฅข๐ :heart: ๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค โค๏ธ",
+ },
+ },
},
}
`;
diff --git a/src/plugins/github/demoData/example-repo.json b/src/plugins/github/demoData/example-repo.json
index 434d6c4..8a5ad23 100644
--- a/src/plugins/github/demoData/example-repo.json
+++ b/src/plugins/github/demoData/example-repo.json
@@ -114,6 +114,42 @@
"id": "MDU6SXNzdWUzMDU5OTM3NzM=",
"number": 6,
"title": "An issue with comments"
+ },
+ {
+ "author": {
+ "__typename": "User",
+ "id": "MDQ6VXNlcjE0MDAwMjM=",
+ "login": "dandelionmane"
+ },
+ "body": "Deal with this, naive string display algorithms!!!!!",
+ "comments": {
+ "nodes": [
+ ],
+ "pageInfo": {
+ "hasNextPage": false
+ }
+ },
+ "id": "MDU6SXNzdWUzMDY5ODM1NTI=",
+ "number": 7,
+ "title": "An issue with an extremely long title, which even has a VerySuperFragicalisticialiManyCharacterUberLongTriplePlusGood word in it, and should really be truncated intelligently or something"
+ },
+ {
+ "author": {
+ "__typename": "User",
+ "id": "MDQ6VXNlcjE0MDAwMjM=",
+ "login": "dandelionmane"
+ },
+ "body": "Issue with Unicode: ศดแฒ๐ฃณๆฅข๐ :heart: ๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค โค๏ธ\r\nIssue with Unicode: ศดแฒ๐ฃณๆฅข๐ :heart: ๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค โค๏ธ",
+ "comments": {
+ "nodes": [
+ ],
+ "pageInfo": {
+ "hasNextPage": false
+ }
+ },
+ "id": "MDU6SXNzdWUzMDY5ODUzNjc=",
+ "number": 8,
+ "title": "Issue with Unicode: ศดแฒ๐ฃณๆฅข๐ :heart: ๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค๐ค โค๏ธ"
}
],
"pageInfo": {