Skip to content

Commit

Permalink
test(acceptance): update fake github server to return the endCursor
Browse files Browse the repository at this point in the history
This corresponds to the change in the previous commit and will bridge
the gap between the test and new data format.
  • Loading branch information
nobe4 committed Dec 1, 2023
1 parent fcbf7d4 commit ad545f3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions spec/acceptance/github-server/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,22 @@ def graphql_org_query(query)

edges = []
cursor_flag = cursor.nil?
end_cursor = nil
result.each do |user, role|
next if !cursor_flag && Base64.strict_encode64(user) != cursor
edges << { "node" => { "login" => user }, "role" => role, "cursor" => Base64.strict_encode64(user) } if cursor_flag
end_cursor = Base64.strict_encode64(user)
next if !cursor_flag && end_cursor != cursor
edges << { "node" => { "login" => user }, "role" => role} if cursor_flag
cursor_flag = true
break if edges.size >= first
end

{
"organization" => {
"membersWithRole" => {
"edges" => edges
"edges" => edges,
"pageInfo" => {
"endCursor" => end_cursor
}
}
}
}
Expand All @@ -144,17 +149,22 @@ def graphql_pending_query(query)

edges = []
cursor_flag = cursor.nil?
end_cursor = nil
result.each do |user|
next if !cursor_flag && Base64.strict_encode64(user) != cursor
edges << { "node" => { "login" => user }, "cursor" => Base64.strict_encode64(user) } if cursor_flag
end_cursor = Base64.strict_encode64(user)
next if !cursor_flag && end_cursor != cursor
edges << { "node" => { "login" => user } } if cursor_flag
cursor_flag = true
break if edges.size >= first
end

{
"organization" => {
"pendingMembers" => {
"edges" => edges
"edges" => edges,
"pageInfo" => {
"endCursor" => end_cursor
}
}
}
}
Expand Down

0 comments on commit ad545f3

Please sign in to comment.