diff options
Diffstat (limited to 'spec/frontend/clusters_list/mocks/apollo.js')
-rw-r--r-- | spec/frontend/clusters_list/mocks/apollo.js | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/spec/frontend/clusters_list/mocks/apollo.js b/spec/frontend/clusters_list/mocks/apollo.js index 27b71a0d4b5..1a7ef84a6d9 100644 --- a/spec/frontend/clusters_list/mocks/apollo.js +++ b/spec/frontend/clusters_list/mocks/apollo.js @@ -1,8 +1,29 @@ +const agent = { + id: 'agent-id', + name: 'agent-name', + webPath: 'agent-webPath', +}; +const token = { + id: 'token-id', + lastUsedAt: null, +}; +const tokens = { + nodes: [token], +}; +const pageInfo = { + endCursor: '', + hasNextPage: false, + hasPreviousPage: false, + startCursor: '', +}; +const count = 1; + export const createAgentResponse = { data: { createClusterAgent: { clusterAgent: { - id: 'agent-id', + ...agent, + tokens, }, errors: [], }, @@ -13,7 +34,8 @@ export const createAgentErrorResponse = { data: { createClusterAgent: { clusterAgent: { - id: 'agent-id', + ...agent, + tokens, }, errors: ['could not create agent'], }, @@ -23,9 +45,7 @@ export const createAgentErrorResponse = { export const createAgentTokenResponse = { data: { clusterAgentTokenCreate: { - token: { - id: 'token-id', - }, + token, secret: 'mock-agent-token', errors: [], }, @@ -35,11 +55,22 @@ export const createAgentTokenResponse = { export const createAgentTokenErrorResponse = { data: { clusterAgentTokenCreate: { - token: { - id: 'token-id', - }, + token, secret: 'mock-agent-token', errors: ['could not create agent token'], }, }, }; + +export const getAgentResponse = { + data: { + project: { + clusterAgents: { nodes: [{ ...agent, tokens }], pageInfo, count }, + repository: { + tree: { + trees: { nodes: [{ ...agent, path: null }], pageInfo }, + }, + }, + }, + }, +}; |