diff options
Diffstat (limited to 'spec/frontend/ci/runner/mock_data.js')
-rw-r--r-- | spec/frontend/ci/runner/mock_data.js | 130 |
1 files changed, 71 insertions, 59 deletions
diff --git a/spec/frontend/ci/runner/mock_data.js b/spec/frontend/ci/runner/mock_data.js index 092a419c1fe..196005c9882 100644 --- a/spec/frontend/ci/runner/mock_data.js +++ b/spec/frontend/ci/runner/mock_data.js @@ -1,5 +1,14 @@ // Fixtures generated by: spec/frontend/fixtures/runner.rb +// List queries +import allRunnersData from 'test_fixtures/graphql/ci/runner/list/all_runners.query.graphql.json'; +import allRunnersDataPaginated from 'test_fixtures/graphql/ci/runner/list/all_runners.query.graphql.paginated.json'; +import allRunnersWithCreatorData from 'test_fixtures/graphql/ci/runner/list/all_runners.query.graphql.with_creator.json'; +import runnersCountData from 'test_fixtures/graphql/ci/runner/list/all_runners_count.query.graphql.json'; +import groupRunnersData from 'test_fixtures/graphql/ci/runner/list/group_runners.query.graphql.json'; +import groupRunnersDataPaginated from 'test_fixtures/graphql/ci/runner/list/group_runners.query.graphql.paginated.json'; +import groupRunnersCountData from 'test_fixtures/graphql/ci/runner/list/group_runners_count.query.graphql.json'; + // Register runner queries import runnerForRegistration from 'test_fixtures/graphql/ci/runner/register/runner_for_registration.query.graphql.json'; @@ -14,16 +23,15 @@ import runnerJobsData from 'test_fixtures/graphql/ci/runner/show/runner_jobs.que import runnerFormData from 'test_fixtures/graphql/ci/runner/edit/runner_form.query.graphql.json'; // New runner queries - -// List queries -import allRunnersData from 'test_fixtures/graphql/ci/runner/list/all_runners.query.graphql.json'; -import allRunnersDataPaginated from 'test_fixtures/graphql/ci/runner/list/all_runners.query.graphql.paginated.json'; -import runnersCountData from 'test_fixtures/graphql/ci/runner/list/all_runners_count.query.graphql.json'; -import groupRunnersData from 'test_fixtures/graphql/ci/runner/list/group_runners.query.graphql.json'; -import groupRunnersDataPaginated from 'test_fixtures/graphql/ci/runner/list/group_runners.query.graphql.paginated.json'; -import groupRunnersCountData from 'test_fixtures/graphql/ci/runner/list/group_runners_count.query.graphql.json'; - -import { DEFAULT_MEMBERSHIP, RUNNER_PAGE_SIZE } from '~/ci/runner/constants'; +import { + DEFAULT_MEMBERSHIP, + INSTANCE_TYPE, + CREATED_DESC, + CREATED_ASC, + STATUS_ONLINE, + STATUS_STALE, + RUNNER_PAGE_SIZE, +} from '~/ci/runner/constants'; import { FILTERED_SEARCH_TERM } from '~/vue_shared/components/filtered_search_bar/constants'; const emptyPageInfo = { @@ -46,29 +54,29 @@ export const mockSearchExamples = [ membership: DEFAULT_MEMBERSHIP, filters: [], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { membership: DEFAULT_MEMBERSHIP, - sort: 'CREATED_DESC', + sort: CREATED_DESC, first: RUNNER_PAGE_SIZE, }, isDefault: true, }, { name: 'a single status', - urlQuery: '?status[]=ACTIVE', + urlQuery: '?status[]=ONLINE', search: { runnerType: null, membership: DEFAULT_MEMBERSHIP, - filters: [{ type: 'status', value: { data: 'ACTIVE', operator: '=' } }], + filters: [{ type: 'status', value: { data: STATUS_ONLINE, operator: '=' } }], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { membership: DEFAULT_MEMBERSHIP, - status: 'ACTIVE', - sort: 'CREATED_DESC', + status: STATUS_ONLINE, + sort: CREATED_DESC, first: RUNNER_PAGE_SIZE, }, }, @@ -85,12 +93,12 @@ export const mockSearchExamples = [ }, ], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { membership: DEFAULT_MEMBERSHIP, search: 'something', - sort: 'CREATED_DESC', + sort: CREATED_DESC, first: RUNNER_PAGE_SIZE, }, }, @@ -111,12 +119,12 @@ export const mockSearchExamples = [ }, ], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { membership: DEFAULT_MEMBERSHIP, search: 'something else', - sort: 'CREATED_DESC', + sort: CREATED_DESC, first: RUNNER_PAGE_SIZE, }, }, @@ -124,54 +132,54 @@ export const mockSearchExamples = [ name: 'single instance type', urlQuery: '?runner_type[]=INSTANCE_TYPE', search: { - runnerType: 'INSTANCE_TYPE', + runnerType: INSTANCE_TYPE, membership: DEFAULT_MEMBERSHIP, filters: [], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { - type: 'INSTANCE_TYPE', + type: INSTANCE_TYPE, membership: DEFAULT_MEMBERSHIP, - sort: 'CREATED_DESC', + sort: CREATED_DESC, first: RUNNER_PAGE_SIZE, }, }, { name: 'multiple runner status', - urlQuery: '?status[]=ACTIVE&status[]=PAUSED', + urlQuery: '?status[]=ONLINE&status[]=STALE', search: { runnerType: null, membership: DEFAULT_MEMBERSHIP, filters: [ - { type: 'status', value: { data: 'ACTIVE', operator: '=' } }, - { type: 'status', value: { data: 'PAUSED', operator: '=' } }, + { type: 'status', value: { data: STATUS_ONLINE, operator: '=' } }, + { type: 'status', value: { data: STATUS_STALE, operator: '=' } }, ], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { - status: 'ACTIVE', + status: STATUS_ONLINE, membership: DEFAULT_MEMBERSHIP, - sort: 'CREATED_DESC', + sort: CREATED_DESC, first: RUNNER_PAGE_SIZE, }, }, { name: 'multiple status, a single instance type and a non default sort', - urlQuery: '?status[]=ACTIVE&runner_type[]=INSTANCE_TYPE&sort=CREATED_ASC', + urlQuery: '?status[]=ONLINE&runner_type[]=INSTANCE_TYPE&sort=CREATED_ASC', search: { - runnerType: 'INSTANCE_TYPE', + runnerType: INSTANCE_TYPE, membership: DEFAULT_MEMBERSHIP, - filters: [{ type: 'status', value: { data: 'ACTIVE', operator: '=' } }], + filters: [{ type: 'status', value: { data: STATUS_ONLINE, operator: '=' } }], pagination: {}, - sort: 'CREATED_ASC', + sort: CREATED_ASC, }, graphqlVariables: { - status: 'ACTIVE', - type: 'INSTANCE_TYPE', + status: STATUS_ONLINE, + type: INSTANCE_TYPE, membership: DEFAULT_MEMBERSHIP, - sort: 'CREATED_ASC', + sort: CREATED_ASC, first: RUNNER_PAGE_SIZE, }, }, @@ -183,13 +191,13 @@ export const mockSearchExamples = [ membership: DEFAULT_MEMBERSHIP, filters: [{ type: 'tag', value: { data: 'tag-1', operator: '=' } }], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { membership: DEFAULT_MEMBERSHIP, tagList: ['tag-1'], - first: 20, - sort: 'CREATED_DESC', + first: RUNNER_PAGE_SIZE, + sort: CREATED_DESC, }, }, { @@ -203,13 +211,13 @@ export const mockSearchExamples = [ { type: 'tag', value: { data: 'tag-2', operator: '=' } }, ], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { membership: DEFAULT_MEMBERSHIP, tagList: ['tag-1', 'tag-2'], - first: 20, - sort: 'CREATED_DESC', + first: RUNNER_PAGE_SIZE, + sort: CREATED_DESC, }, }, { @@ -220,11 +228,11 @@ export const mockSearchExamples = [ membership: DEFAULT_MEMBERSHIP, filters: [], pagination: { after: 'AFTER_CURSOR' }, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { membership: DEFAULT_MEMBERSHIP, - sort: 'CREATED_DESC', + sort: CREATED_DESC, after: 'AFTER_CURSOR', first: RUNNER_PAGE_SIZE, }, @@ -237,11 +245,11 @@ export const mockSearchExamples = [ membership: DEFAULT_MEMBERSHIP, filters: [], pagination: { before: 'BEFORE_CURSOR' }, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { membership: DEFAULT_MEMBERSHIP, - sort: 'CREATED_DESC', + sort: CREATED_DESC, before: 'BEFORE_CURSOR', last: RUNNER_PAGE_SIZE, }, @@ -249,24 +257,24 @@ export const mockSearchExamples = [ { name: 'the next page filtered by a status, an instance type, tags and a non default sort', urlQuery: - '?status[]=ACTIVE&runner_type[]=INSTANCE_TYPE&tag[]=tag-1&tag[]=tag-2&sort=CREATED_ASC&after=AFTER_CURSOR', + '?status[]=ONLINE&runner_type[]=INSTANCE_TYPE&tag[]=tag-1&tag[]=tag-2&sort=CREATED_ASC&after=AFTER_CURSOR', search: { - runnerType: 'INSTANCE_TYPE', + runnerType: INSTANCE_TYPE, membership: DEFAULT_MEMBERSHIP, filters: [ - { type: 'status', value: { data: 'ACTIVE', operator: '=' } }, + { type: 'status', value: { data: STATUS_ONLINE, operator: '=' } }, { type: 'tag', value: { data: 'tag-1', operator: '=' } }, { type: 'tag', value: { data: 'tag-2', operator: '=' } }, ], pagination: { after: 'AFTER_CURSOR' }, - sort: 'CREATED_ASC', + sort: CREATED_ASC, }, graphqlVariables: { - status: 'ACTIVE', - type: 'INSTANCE_TYPE', + status: STATUS_ONLINE, + type: INSTANCE_TYPE, membership: DEFAULT_MEMBERSHIP, tagList: ['tag-1', 'tag-2'], - sort: 'CREATED_ASC', + sort: CREATED_ASC, after: 'AFTER_CURSOR', first: RUNNER_PAGE_SIZE, }, @@ -279,12 +287,12 @@ export const mockSearchExamples = [ membership: DEFAULT_MEMBERSHIP, filters: [{ type: 'paused', value: { data: 'true', operator: '=' } }], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { paused: true, membership: DEFAULT_MEMBERSHIP, - sort: 'CREATED_DESC', + sort: CREATED_DESC, first: RUNNER_PAGE_SIZE, }, }, @@ -296,12 +304,12 @@ export const mockSearchExamples = [ membership: DEFAULT_MEMBERSHIP, filters: [{ type: 'paused', value: { data: 'false', operator: '=' } }], pagination: {}, - sort: 'CREATED_DESC', + sort: CREATED_DESC, }, graphqlVariables: { paused: false, membership: DEFAULT_MEMBERSHIP, - sort: 'CREATED_DESC', + sort: CREATED_DESC, first: RUNNER_PAGE_SIZE, }, }, @@ -310,12 +318,16 @@ export const mockSearchExamples = [ export const onlineContactTimeoutSecs = 2 * 60 * 60; export const staleTimeoutSecs = 7889238; // Ruby's `3.months` +export const mockRegistrationToken = 'MOCK_REGISTRATION_TOKEN'; +export const mockAuthenticationToken = 'MOCK_AUTHENTICATION_TOKEN'; + export const newRunnerPath = '/runners/new'; export const emptyStateSvgPath = 'emptyStateSvgPath.svg'; export const emptyStateFilteredSvgPath = 'emptyStateFilteredSvgPath.svg'; export { allRunnersData, + allRunnersWithCreatorData, allRunnersDataPaginated, runnersCountData, groupRunnersData, |