Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Feb 5, 2025
1 parent 8a7952c commit e59a28b
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 15 deletions.
63 changes: 48 additions & 15 deletions graphql/tests/project/patches/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions graphql/tests/project/patches/queries/only_merge_queue.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
project(projectIdentifier: "spruce") {
patches(patchesInput: { onlyMergeQueue: true }) {
patches {
id
}
filteredPatchCount
}
}
}
48 changes: 48 additions & 0 deletions graphql/tests/project/patches/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e59a28b

Please sign in to comment.