listResp builds a mock repository.discussions JSON response.
(hasNext bool, endCursor string, total int, nodes string)
| 68 | |
| 69 | // listResp builds a mock repository.discussions JSON response. |
| 70 | func listResp(hasNext bool, endCursor string, total int, nodes string) string { |
| 71 | return heredoc.Docf(` |
| 72 | { |
| 73 | "data": { |
| 74 | "repository": { |
| 75 | "hasDiscussionsEnabled": true, |
| 76 | "discussions": { |
| 77 | "totalCount": %d, |
| 78 | "pageInfo": { |
| 79 | "hasNextPage": %t, |
| 80 | "endCursor": %q |
| 81 | }, |
| 82 | "nodes": [%s] |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | `, total, hasNext, endCursor, nodes) |
| 88 | } |
| 89 | |
| 90 | // searchResp builds a mock search JSON response. |
| 91 | func searchResp(hasNext bool, endCursor string, count int, nodes string) string { |