2
0
mirror of https://github.com/status-im/sourcecred.git synced 2025-03-02 13:10:31 +00:00

mirror: add reaction to snapshot test query ()

Summary:
Upcoming changes will add support for field-level fidelity annotations
(see ), at which point the `Reaction.user` field will be marked
unfaithful. This patch will surface that behavior change.

Test Plan:
The newly snapshotted query is valid, and returns a reaction whose
`user` property lists typename and ID.

wchargin-branch: mirror-snapshot-reaction
This commit is contained in:
William Chargin 2020-02-07 20:54:02 -08:00 committed by GitHub
parent d6a2618e9e
commit 86c31415c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions
src/graphql

@ -259,6 +259,17 @@ exports[`graphql/mirror Mirror _updateOwnData snapshot test for actual GitHub qu
title
}
}
reaction: node(id: \\"MDg6UmVhY3Rpb24yOTUzNDM4Mw==\\") {
... on Reaction {
__typename
id
content
user {
__typename
id
}
}
}
commit: node(id: \\"MDY6Q29tbWl0MTIwMTQ1NTcwOjU1OTUwZjUzNTQ1NTEwOWJhNDhhYmYyYjk3N2U2NmFhMWNjMzVlNjk=\\") {
... on Commit {
__typename

@ -2364,6 +2364,7 @@ describe("graphql/mirror", () => {
const db = new Database(":memory:");
const mirror = new Mirror(db, buildGithubSchema());
const exampleIssueId = "MDU6SXNzdWUzNDg1NDA0NjE=";
const exampleReactionId = "MDg6UmVhY3Rpb24yOTUzNDM4Mw==";
const exampleCommitId =
"MDY6Q29tbWl0MTIwMTQ1NTcwOjU1OTUwZjUzNTQ1NTEwOWJhNDhhYmYyYjk3N2U2NmFhMWNjMzVlNjk=";
const b = Queries.build;
@ -2377,6 +2378,12 @@ describe("graphql/mirror", () => {
b.inlineFragment("Issue", mirror._queryOwnData("Issue")),
])
),
b.alias(
"reaction",
b.field("node", {id: b.literal(exampleReactionId)}, [
b.inlineFragment("Reaction", mirror._queryOwnData("Reaction")),
])
),
b.alias(
"commit",
b.field("node", {id: b.literal(exampleCommitId)}, [