diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/frontend/logs | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/frontend/logs')
-rw-r--r-- | spec/frontend/logs/components/environment_logs_spec.js | 12 | ||||
-rw-r--r-- | spec/frontend/logs/components/log_advanced_filters_spec.js | 2 | ||||
-rw-r--r-- | spec/frontend/logs/components/log_simple_filters_spec.js | 4 | ||||
-rw-r--r-- | spec/frontend/logs/mock_data.js | 10 | ||||
-rw-r--r-- | spec/frontend/logs/stores/actions_spec.js | 2 | ||||
-rw-r--r-- | spec/frontend/logs/stores/mutations_spec.js | 3 |
6 files changed, 22 insertions, 11 deletions
diff --git a/spec/frontend/logs/components/environment_logs_spec.js b/spec/frontend/logs/components/environment_logs_spec.js index dee62709d81..6421aca684f 100644 --- a/spec/frontend/logs/components/environment_logs_spec.js +++ b/spec/frontend/logs/components/environment_logs_spec.js @@ -1,4 +1,4 @@ -import { GlSprintf, GlIcon, GlDropdown, GlDropdownItem } from '@gitlab/ui'; +import { GlSprintf, GlIcon, GlDeprecatedDropdown, GlDeprecatedDropdownItem } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import EnvironmentLogs from '~/logs/components/environment_logs.vue'; @@ -124,7 +124,7 @@ describe('EnvironmentLogs', () => { expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isEmpty()).toBe(false); - expect(findEnvironmentsDropdown().is(GlDropdown)).toBe(true); + expect(findEnvironmentsDropdown().is(GlDeprecatedDropdown)).toBe(true); expect(findSimpleFilters().exists()).toBe(true); expect(findLogControlButtons().exists()).toBe(true); @@ -167,7 +167,7 @@ describe('EnvironmentLogs', () => { it('displays a disabled environments dropdown', () => { expect(findEnvironmentsDropdown().attributes('disabled')).toBe('true'); - expect(findEnvironmentsDropdown().findAll(GlDropdownItem).length).toBe(0); + expect(findEnvironmentsDropdown().findAll(GlDeprecatedDropdownItem).length).toBe(0); }); it('does not update buttons state', () => { @@ -244,7 +244,7 @@ describe('EnvironmentLogs', () => { }); it('populates environments dropdown', () => { - const items = findEnvironmentsDropdown().findAll(GlDropdownItem); + const items = findEnvironmentsDropdown().findAll(GlDeprecatedDropdownItem); expect(findEnvironmentsDropdown().props('text')).toBe(mockEnvName); expect(items.length).toBe(mockEnvironments.length); mockEnvironments.forEach((env, i) => { @@ -254,7 +254,7 @@ describe('EnvironmentLogs', () => { }); it('dropdown has one environment selected', () => { - const items = findEnvironmentsDropdown().findAll(GlDropdownItem); + const items = findEnvironmentsDropdown().findAll(GlDeprecatedDropdownItem); mockEnvironments.forEach((env, i) => { const item = items.at(i); @@ -289,7 +289,7 @@ describe('EnvironmentLogs', () => { describe('when user clicks', () => { it('environment name, trace is refreshed', () => { - const items = findEnvironmentsDropdown().findAll(GlDropdownItem); + const items = findEnvironmentsDropdown().findAll(GlDeprecatedDropdownItem); const index = 1; // any env expect(dispatch).not.toHaveBeenCalledWith(`${module}/showEnvironment`, expect.anything()); diff --git a/spec/frontend/logs/components/log_advanced_filters_spec.js b/spec/frontend/logs/components/log_advanced_filters_spec.js index adcd6b4fb07..007c5000e16 100644 --- a/spec/frontend/logs/components/log_advanced_filters_spec.js +++ b/spec/frontend/logs/components/log_advanced_filters_spec.js @@ -1,6 +1,6 @@ import { shallowMount } from '@vue/test-utils'; -import { defaultTimeRange } from '~/vue_shared/constants'; import { GlFilteredSearch } from '@gitlab/ui'; +import { defaultTimeRange } from '~/vue_shared/constants'; import { convertToFixedRange } from '~/lib/utils/datetime_range'; import { createStore } from '~/logs/stores'; import { TOKEN_TYPE_POD_NAME } from '~/logs/constants'; diff --git a/spec/frontend/logs/components/log_simple_filters_spec.js b/spec/frontend/logs/components/log_simple_filters_spec.js index 13504a2b1fc..e739621431e 100644 --- a/spec/frontend/logs/components/log_simple_filters_spec.js +++ b/spec/frontend/logs/components/log_simple_filters_spec.js @@ -1,4 +1,4 @@ -import { GlIcon, GlDropdownItem } from '@gitlab/ui'; +import { GlIcon, GlDeprecatedDropdownItem } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { createStore } from '~/logs/stores'; import { mockPods, mockPodName } from '../mock_data'; @@ -17,7 +17,7 @@ describe('LogSimpleFilters', () => { const findPodsNoPodsText = () => wrapper.find({ ref: 'noPodsMsg' }); const findPodsDropdownItems = () => findPodsDropdown() - .findAll(GlDropdownItem) + .findAll(GlDeprecatedDropdownItem) .filter(item => !item.is('[disabled]')); const mockPodsLoading = () => { diff --git a/spec/frontend/logs/mock_data.js b/spec/frontend/logs/mock_data.js index f9b3508e01c..f4c567a2ea3 100644 --- a/spec/frontend/logs/mock_data.js +++ b/spec/frontend/logs/mock_data.js @@ -36,6 +36,16 @@ export const mockManagedApps = [ path: '/root/autodevops-deploy/-/clusters/15', gitlab_managed_apps_logs_path: '/root/autodevops-deploy/-/logs?cluster_id=15', }, + { + cluster_type: 'project_type', + enabled: true, + environment_scope: '*', + name: 'kubernetes-cluster-2', + provider_type: 'user', + status: 'connected', + path: '/root/autodevops-deploy/-/clusters/16', + gitlab_managed_apps_logs_path: null, + }, ]; export const mockPodName = 'production-764c58d697-aaaaa'; diff --git a/spec/frontend/logs/stores/actions_spec.js b/spec/frontend/logs/stores/actions_spec.js index acd9536a682..e4501abdc76 100644 --- a/spec/frontend/logs/stores/actions_spec.js +++ b/spec/frontend/logs/stores/actions_spec.js @@ -17,7 +17,7 @@ import { import { defaultTimeRange } from '~/vue_shared/constants'; import axios from '~/lib/utils/axios_utils'; -import flash from '~/flash'; +import { deprecatedCreateFlash as flash } from '~/flash'; import { mockPodName, diff --git a/spec/frontend/logs/stores/mutations_spec.js b/spec/frontend/logs/stores/mutations_spec.js index 137533f02d7..4a095e0f26e 100644 --- a/spec/frontend/logs/stores/mutations_spec.js +++ b/spec/frontend/logs/stores/mutations_spec.js @@ -272,7 +272,8 @@ describe('Logs Store Mutations', () => { mutations[types.RECEIVE_MANAGED_APPS_DATA_SUCCESS](state, mockManagedApps); - expect(state.managedApps.options).toEqual(mockManagedApps); + expect(state.managedApps.options.length).toEqual(1); + expect(state.managedApps.options).toEqual([mockManagedApps[0]]); expect(state.managedApps.isLoading).toBe(false); }); }); |