diff --git a/graphql/tests/project/patches/data.json b/graphql/tests/project/patches/data.json index 77bc9a6522..4be87edfa9 100644 --- a/graphql/tests/project/patches/data.json +++ b/graphql/tests/project/patches/data.json @@ -18,54 +18,87 @@ "patches": [ { "branch": "spruce", - "_id": { "$oid": "5e4ff3abe3c3317e352062e4" }, + "_id": { + "$oid": "5e4ff3abe3c3317e352062e4" + }, "author": "regular_user", - "create_time": { "$date": "2020-01-01T00:00:01Z" }, + "create_time": { + "$date": "2020-01-01T00:00:01Z" + }, "desc": "1", "status": "created", - "alias": "__commit_queue" + "alias": "__commit_queue", + "github_merge_data": { + "head_sha": "5e4ff3a" + } }, { "branch": "spruce", - "_id": { "$oid": "5e4ff3abe3c3317e352062e5" }, + "_id": { + "$oid": "5e4ff3abe3c3317e352062e5" + }, "author": "regular_user", - "create_time": { "$date": "2020-01-01T00:00:02Z" }, + "create_time": { + "$date": "2020-01-01T00:00:02Z" + }, "desc": "222", "status": "created", - "alias": "__commit_queue" + "alias": "__commit_queue", + "github_merge_data": { + "head_sha": "5e4ff3f" + } }, { "branch": "spruce", - "_id": { "$oid": "5e4ff3abe3c3317e352062e6" }, + "_id": { + "$oid": "5e4ff3abe3c3317e352062e6" + }, "author": "regular_user", - "create_time": { "$date": "2020-01-01T00:00:03Z" }, + "create_time": { + "$date": "2020-01-01T00:00:03Z" + }, "desc": "1", "status": "created", - "alias": "__commit_queue" + "alias": "__commit_queue", + "github_merge_data": { + "head_sha": "3d4ff3a" + } }, { "branch": "spruce", - "_id": { "$oid": "5e4ff3abe3c3317e352062e7" }, + "_id": { + "$oid": "5e4ff3abe3c3317e352062e7" + }, "author": "regular_user", - "create_time": { "$date": "2020-01-01T00:00:04Z" }, + "create_time": { + "$date": "2020-01-01T00:00:04Z" + }, "desc": "222", "status": "failed", "alias": "__github" }, { "branch": "spruce", - "_id": { "$oid": "5e4ff3abe3c3317e352062e8" }, + "_id": { + "$oid": "5e4ff3abe3c3317e352062e8" + }, "author": "regular_user", - "create_time": { "$date": "2020-01-01T00:00:05Z" }, + "create_time": { + "$date": "2020-01-01T00:00:05Z" + }, "desc": "1", "status": "created", "alias": "__github" }, { "branch": "spruce", - "_id": { "$oid": "5e4ff3abe3c3317e352062e9" }, + "_id": { + "$oid": "5e4ff3abe3c3317e352062e9" + }, "author": "regular_user", - "create_time": { "$date": "2019-01-01T00:00:06Z" }, + "create_time": { + "$date": "2019-01-01T00:00:06Z" + }, "desc": "222", "status": "failed", "alias": "__github" diff --git a/graphql/tests/project/patches/queries/only_merge_queue.graphql b/graphql/tests/project/patches/queries/only_merge_queue.graphql new file mode 100644 index 0000000000..be3ac82c3c --- /dev/null +++ b/graphql/tests/project/patches/queries/only_merge_queue.graphql @@ -0,0 +1,10 @@ +{ + project(projectIdentifier: "spruce") { + patches(patchesInput: { onlyMergeQueue: true }) { + patches { + id + } + filteredPatchCount + } + } +} diff --git a/graphql/tests/project/patches/results.json b/graphql/tests/project/patches/results.json index cada4f1bbc..d53c301bc1 100644 --- a/graphql/tests/project/patches/results.json +++ b/graphql/tests/project/patches/results.json @@ -207,6 +207,54 @@ } } }, + { + "query_file": "only_commit_queue.graphql", + "test_user_id": "regular_user", + "result": { + "data": { + "project": { + "patches": { + "patches": [ + { + "id": "5e4ff3abe3c3317e352062e6" + }, + { + "id": "5e4ff3abe3c3317e352062e5" + }, + { + "id": "5e4ff3abe3c3317e352062e4" + } + ], + "filteredPatchCount": 3 + } + } + } + } + }, + { + "query_file": "only_merge_queue.graphql", + "test_user_id": "regular_user", + "result": { + "data": { + "project": { + "patches": { + "patches": [ + { + "id": "5e4ff3abe3c3317e352062e6" + }, + { + "id": "5e4ff3abe3c3317e352062e5" + }, + { + "id": "5e4ff3abe3c3317e352062e4" + } + ], + "filteredPatchCount": 3 + } + } + } + } + }, { "query_file": "no_permissions.graphql", "test_user_id": "regular_user",