2021-12-11 22:18:48 +05:30
|
|
|
const agent = {
|
|
|
|
id: 'agent-id',
|
|
|
|
name: 'agent-name',
|
|
|
|
webPath: 'agent-webPath',
|
|
|
|
};
|
|
|
|
const token = {
|
|
|
|
id: 'token-id',
|
|
|
|
lastUsedAt: null,
|
|
|
|
};
|
|
|
|
const tokens = {
|
|
|
|
nodes: [token],
|
|
|
|
};
|
2022-04-04 11:22:00 +05:30
|
|
|
const connections = {
|
|
|
|
nodes: [],
|
|
|
|
};
|
2021-12-11 22:18:48 +05:30
|
|
|
const pageInfo = {
|
|
|
|
endCursor: '',
|
|
|
|
hasNextPage: false,
|
|
|
|
hasPreviousPage: false,
|
|
|
|
startCursor: '',
|
|
|
|
};
|
|
|
|
const count = 1;
|
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
export const createAgentResponse = {
|
|
|
|
data: {
|
|
|
|
createClusterAgent: {
|
|
|
|
clusterAgent: {
|
2021-12-11 22:18:48 +05:30
|
|
|
...agent,
|
2022-04-04 11:22:00 +05:30
|
|
|
connections,
|
2021-12-11 22:18:48 +05:30
|
|
|
tokens,
|
2021-11-18 22:05:49 +05:30
|
|
|
},
|
|
|
|
errors: [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const createAgentErrorResponse = {
|
|
|
|
data: {
|
|
|
|
createClusterAgent: {
|
|
|
|
clusterAgent: {
|
2021-12-11 22:18:48 +05:30
|
|
|
...agent,
|
2022-04-04 11:22:00 +05:30
|
|
|
connections,
|
2021-12-11 22:18:48 +05:30
|
|
|
tokens,
|
2021-11-18 22:05:49 +05:30
|
|
|
},
|
|
|
|
errors: ['could not create agent'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const createAgentTokenResponse = {
|
|
|
|
data: {
|
|
|
|
clusterAgentTokenCreate: {
|
2021-12-11 22:18:48 +05:30
|
|
|
token,
|
2021-11-18 22:05:49 +05:30
|
|
|
secret: 'mock-agent-token',
|
|
|
|
errors: [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const createAgentTokenErrorResponse = {
|
|
|
|
data: {
|
|
|
|
clusterAgentTokenCreate: {
|
2021-12-11 22:18:48 +05:30
|
|
|
token,
|
2021-11-18 22:05:49 +05:30
|
|
|
secret: 'mock-agent-token',
|
|
|
|
errors: ['could not create agent token'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2021-12-11 22:18:48 +05:30
|
|
|
|
|
|
|
export const getAgentResponse = {
|
|
|
|
data: {
|
|
|
|
project: {
|
2022-04-04 11:22:00 +05:30
|
|
|
__typename: 'Project',
|
2022-01-26 12:08:38 +05:30
|
|
|
id: 'project-1',
|
2022-04-04 11:22:00 +05:30
|
|
|
clusterAgents: { nodes: [{ ...agent, connections, tokens }], pageInfo, count },
|
2021-12-11 22:18:48 +05:30
|
|
|
repository: {
|
|
|
|
tree: {
|
|
|
|
trees: { nodes: [{ ...agent, path: null }], pageInfo },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-03-02 08:16:31 +05:30
|
|
|
|
2022-04-04 11:22:00 +05:30
|
|
|
export const kasDisabledErrorResponse = {
|
|
|
|
data: {},
|
|
|
|
errors: [{ message: 'Gitlab::Kas::Client::ConfigurationError' }],
|
|
|
|
};
|
|
|
|
|
2022-03-02 08:16:31 +05:30
|
|
|
export const mockDeleteResponse = {
|
|
|
|
data: { clusterAgentDelete: { errors: [] } },
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockErrorDeleteResponse = {
|
|
|
|
data: {
|
|
|
|
clusterAgentDelete: {
|
|
|
|
errors: ['could not delete agent'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|