diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/frontend/logs | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/frontend/logs')
6 files changed, 12 insertions, 14 deletions
diff --git a/spec/frontend/logs/components/environment_logs_spec.js b/spec/frontend/logs/components/environment_logs_spec.js index e32deaea993..351ff317feb 100644 --- a/spec/frontend/logs/components/environment_logs_spec.js +++ b/spec/frontend/logs/components/environment_logs_spec.js @@ -20,7 +20,7 @@ jest.mock('~/lib/utils/scroll_utils'); const module = 'environmentLogs'; jest.mock('lodash/throttle', () => - jest.fn(func => { + jest.fn((func) => { return func; }), ); @@ -59,7 +59,7 @@ describe('EnvironmentLogs', () => { const findInfiniteScroll = () => wrapper.find({ ref: 'infiniteScroll' }); const findLogTrace = () => wrapper.find({ ref: 'logTrace' }); const findLogFooter = () => wrapper.find({ ref: 'logFooter' }); - const getInfiniteScrollAttr = attr => parseInt(findInfiniteScroll().attributes(attr), 10); + const getInfiniteScrollAttr = (attr) => parseInt(findInfiniteScroll().attributes(attr), 10); const mockSetInitData = () => { state.pods.options = mockPods; @@ -181,11 +181,7 @@ describe('EnvironmentLogs', () => { it('shows a logs trace', () => { expect(findLogTrace().text()).toBe(''); - expect( - findLogTrace() - .find('.js-build-loader-animation') - .isVisible(), - ).toBe(true); + expect(findLogTrace().find('.js-build-loader-animation').isVisible()).toBe(true); }); }); @@ -217,7 +213,7 @@ describe('EnvironmentLogs', () => { describe('state with data', () => { beforeEach(() => { - dispatch.mockImplementation(actionName => { + dispatch.mockImplementation((actionName) => { if (actionName === `${module}/setInitData`) { mockSetInitData(); } else if (actionName === `${module}/showPodLogs`) { diff --git a/spec/frontend/logs/components/log_advanced_filters_spec.js b/spec/frontend/logs/components/log_advanced_filters_spec.js index 3a3c23c95b8..dfa8913a301 100644 --- a/spec/frontend/logs/components/log_advanced_filters_spec.js +++ b/spec/frontend/logs/components/log_advanced_filters_spec.js @@ -18,10 +18,10 @@ describe('LogAdvancedFilters', () => { const findFilteredSearch = () => wrapper.find(GlFilteredSearch); const findTimeRangePicker = () => wrapper.find({ ref: 'dateTimePicker' }); - const getSearchToken = type => + const getSearchToken = (type) => findFilteredSearch() .props('availableTokens') - .filter(token => token.type === type)[0]; + .filter((token) => token.type === type)[0]; const mockStateLoading = () => { state.timeRange.selected = defaultTimeRange; @@ -73,6 +73,8 @@ describe('LogAdvancedFilters', () => { }); it('displays search tokens', () => { + initWrapper(); + expect(getSearchToken(TOKEN_TYPE_POD_NAME)).toMatchObject({ title: 'Pod name', unique: true, diff --git a/spec/frontend/logs/components/log_control_buttons_spec.js b/spec/frontend/logs/components/log_control_buttons_spec.js index dff38ecb15e..55b28445786 100644 --- a/spec/frontend/logs/components/log_control_buttons_spec.js +++ b/spec/frontend/logs/components/log_control_buttons_spec.js @@ -9,7 +9,7 @@ describe('LogControlButtons', () => { const findScrollToBottom = () => wrapper.find('.js-scroll-to-bottom'); const findRefreshBtn = () => wrapper.find('.js-refresh-log'); - const initWrapper = opts => { + const initWrapper = (opts) => { wrapper = shallowMount(LogControlButtons, { listeners: { scrollUp: () => {}, diff --git a/spec/frontend/logs/components/log_simple_filters_spec.js b/spec/frontend/logs/components/log_simple_filters_spec.js index b819f0d25a8..5bd42fd7dbc 100644 --- a/spec/frontend/logs/components/log_simple_filters_spec.js +++ b/spec/frontend/logs/components/log_simple_filters_spec.js @@ -18,7 +18,7 @@ describe('LogSimpleFilters', () => { const findPodsDropdownItems = () => findPodsDropdown() .findAll(GlDropdownItem) - .filter(item => !('disabled' in item.attributes())); + .filter((item) => !('disabled' in item.attributes())); const mockPodsLoading = () => { state.pods.options = []; diff --git a/spec/frontend/logs/stores/actions_spec.js b/spec/frontend/logs/stores/actions_spec.js index e4501abdc76..bc58f1e677f 100644 --- a/spec/frontend/logs/stores/actions_spec.js +++ b/spec/frontend/logs/stores/actions_spec.js @@ -62,7 +62,7 @@ describe('Logs Store actions', () => { const latestGetParams = () => mock.history.get[mock.history.get.length - 1].params; - convertToFixedRange.mockImplementation(range => { + convertToFixedRange.mockImplementation((range) => { if (range === defaultTimeRange) { return { ...mockDefaultRange }; } diff --git a/spec/frontend/logs/stores/mutations_spec.js b/spec/frontend/logs/stores/mutations_spec.js index 4a095e0f26e..51f6494b011 100644 --- a/spec/frontend/logs/stores/mutations_spec.js +++ b/spec/frontend/logs/stores/mutations_spec.js @@ -23,7 +23,7 @@ describe('Logs Store Mutations', () => { }); it('ensures mutation types are correctly named', () => { - Object.keys(types).forEach(k => { + Object.keys(types).forEach((k) => { expect(k).toEqual(types[k]); }); }); |