diff options
Diffstat (limited to 'spec/frontend/clusters_list/components/mock_data.js')
-rw-r--r-- | spec/frontend/clusters_list/components/mock_data.js | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/spec/frontend/clusters_list/components/mock_data.js b/spec/frontend/clusters_list/components/mock_data.js index e388d791b89..3d18b22d727 100644 --- a/spec/frontend/clusters_list/components/mock_data.js +++ b/spec/frontend/clusters_list/components/mock_data.js @@ -1,3 +1,5 @@ +import { ACTIVE_CONNECTION_TIME } from '~/clusters_list/constants'; + export const agentConfigurationsResponse = { data: { project: { @@ -10,3 +12,113 @@ export const agentConfigurationsResponse = { }, }, }; + +export const connectedTimeNow = new Date(); +export const connectedTimeInactive = new Date(connectedTimeNow.getTime() - ACTIVE_CONNECTION_TIME); + +export const clusterAgents = [ + { + name: 'agent-1', + id: 'agent-1-id', + configFolder: { + webPath: '/agent/full/path', + }, + webPath: '/agent-1', + status: 'unused', + lastContact: null, + tokens: null, + }, + { + name: 'agent-2', + id: 'agent-2-id', + webPath: '/agent-2', + status: 'active', + lastContact: connectedTimeNow.getTime(), + connections: { + nodes: [ + { + metadata: { version: 'v14.8' }, + }, + { + metadata: { version: 'v14.8' }, + }, + ], + }, + tokens: { + nodes: [ + { + lastUsedAt: connectedTimeNow, + }, + ], + }, + }, + { + name: 'agent-3', + id: 'agent-3-id', + webPath: '/agent-3', + status: 'inactive', + lastContact: connectedTimeInactive.getTime(), + connections: { + nodes: [ + { + metadata: { version: 'v14.5' }, + }, + ], + }, + tokens: { + nodes: [ + { + lastUsedAt: connectedTimeInactive, + }, + ], + }, + }, + { + name: 'agent-4', + id: 'agent-4-id', + webPath: '/agent-4', + status: 'inactive', + lastContact: connectedTimeInactive.getTime(), + connections: { + nodes: [ + { + metadata: { version: 'v14.7' }, + }, + { + metadata: { version: 'v14.8' }, + }, + ], + }, + tokens: { + nodes: [ + { + lastUsedAt: connectedTimeInactive, + }, + ], + }, + }, + { + name: 'agent-5', + id: 'agent-5-id', + webPath: '/agent-5', + status: 'inactive', + lastContact: connectedTimeInactive.getTime(), + connections: { + nodes: [ + { + metadata: { version: 'v14.5' }, + }, + { + metadata: { version: 'v14.3' }, + }, + ], + }, + tokens: { + nodes: [ + { + lastUsedAt: connectedTimeInactive, + }, + ], + }, + }, +]; |