diff options
Diffstat (limited to 'spec/frontend/monitoring')
7 files changed, 18 insertions, 17 deletions
diff --git a/spec/frontend/monitoring/components/charts/column_spec.js b/spec/frontend/monitoring/components/charts/column_spec.js index 16e2080c000..fbcff33d692 100644 --- a/spec/frontend/monitoring/components/charts/column_spec.js +++ b/spec/frontend/monitoring/components/charts/column_spec.js @@ -30,6 +30,7 @@ describe('Column component', () => { }, metrics: [ { + label: 'Mock data', result: [ { metric: {}, @@ -96,7 +97,7 @@ describe('Column component', () => { describe('wrapped components', () => { describe('GitLab UI column chart', () => { it('receives data properties needed for proper chart render', () => { - expect(chartProps('data').values).toEqual(dataValues); + expect(chartProps('bars')).toEqual([{ name: 'Mock data', data: dataValues }]); }); it('passes the y axis name correctly', () => { diff --git a/spec/frontend/monitoring/components/charts/stacked_column_spec.js b/spec/frontend/monitoring/components/charts/stacked_column_spec.js index 24a2af87eb8..2032258730a 100644 --- a/spec/frontend/monitoring/components/charts/stacked_column_spec.js +++ b/spec/frontend/monitoring/components/charts/stacked_column_spec.js @@ -44,19 +44,19 @@ describe('Stacked column chart component', () => { }); it('data should match the graphData y value for each series', () => { - const data = findChart().props('data'); + const data = findChart().props('bars'); data.forEach((series, index) => { const { values } = stackedColumnMockedData.metrics[index].result[0]; - expect(series).toEqual(values.map(value => value[1])); + expect(series.data).toEqual(values.map(value => value[1])); }); }); - it('series names should be the same as the graphData metrics labels', () => { - const seriesNames = findChart().props('seriesNames'); + it('data should be the same length as the graphData metrics labels', () => { + const barDataProp = findChart().props('bars'); - expect(seriesNames).toHaveLength(stackedColumnMockedData.metrics.length); - seriesNames.forEach((name, index) => { + expect(barDataProp).toHaveLength(stackedColumnMockedData.metrics.length); + barDataProp.forEach(({ name }, index) => { expect(stackedColumnMockedData.metrics[index].label).toBe(name); }); }); diff --git a/spec/frontend/monitoring/components/charts/time_series_spec.js b/spec/frontend/monitoring/components/charts/time_series_spec.js index 7f0ff534db3..8fcee80a2d8 100644 --- a/spec/frontend/monitoring/components/charts/time_series_spec.js +++ b/spec/frontend/monitoring/components/charts/time_series_spec.js @@ -226,7 +226,7 @@ describe('Time series component', () => { ]); expect( - shallowWrapperContainsSlotText(wrapper.find(GlLineChart), 'tooltipContent', value), + shallowWrapperContainsSlotText(wrapper.find(GlLineChart), 'tooltip-content', value), ).toBe(true); }); @@ -651,7 +651,7 @@ describe('Time series component', () => { return wrapper.vm.$nextTick(() => { expect( - shallowWrapperContainsSlotText(findChartComponent(), 'tooltipTitle', mockTitle), + shallowWrapperContainsSlotText(findChartComponent(), 'tooltip-title', mockTitle), ).toBe(true); }); }); @@ -671,7 +671,7 @@ describe('Time series component', () => { it('uses deployment title', () => { expect( - shallowWrapperContainsSlotText(findChartComponent(), 'tooltipTitle', 'Deployed'), + shallowWrapperContainsSlotText(findChartComponent(), 'tooltip-title', 'Deployed'), ).toBe(true); }); diff --git a/spec/frontend/monitoring/components/dashboard_panel_spec.js b/spec/frontend/monitoring/components/dashboard_panel_spec.js index ee0e1fd3176..1808faf8f0e 100644 --- a/spec/frontend/monitoring/components/dashboard_panel_spec.js +++ b/spec/frontend/monitoring/components/dashboard_panel_spec.js @@ -106,7 +106,7 @@ describe('Dashboard Panel', () => { {}, { slots: { - topLeft: `<div class="top-left-content">OK</div>`, + 'top-left': `<div class="top-left-content">OK</div>`, }, }, ); diff --git a/spec/frontend/monitoring/components/dashboard_spec.js b/spec/frontend/monitoring/components/dashboard_spec.js index b7a0ea46b61..27e479ba498 100644 --- a/spec/frontend/monitoring/components/dashboard_spec.js +++ b/spec/frontend/monitoring/components/dashboard_spec.js @@ -508,7 +508,7 @@ describe('Dashboard', () => { const mockKeyup = key => window.dispatchEvent(new KeyboardEvent('keyup', { key })); const MockPanel = { - template: `<div><slot name="topLeft"/></div>`, + template: `<div><slot name="top-left"/></div>`, }; beforeEach(() => { diff --git a/spec/frontend/monitoring/components/embeds/embed_group_spec.js b/spec/frontend/monitoring/components/embeds/embed_group_spec.js index b63995ec2d4..01089752933 100644 --- a/spec/frontend/monitoring/components/embeds/embed_group_spec.js +++ b/spec/frontend/monitoring/components/embeds/embed_group_spec.js @@ -73,7 +73,7 @@ describe('Embed Group', () => { metricsWithDataGetter.mockReturnValue([1]); mountComponent({ shallow: false, stubs: { MetricEmbed: true } }); - expect(wrapper.find('.card-body').classes()).not.toContain('d-none'); + expect(wrapper.find('.gl-card-body').classes()).not.toContain('d-none'); }); it('collapses when clicked', done => { @@ -83,7 +83,7 @@ describe('Embed Group', () => { wrapper.find(GlButton).trigger('click'); wrapper.vm.$nextTick(() => { - expect(wrapper.find('.card-body').classes()).toContain('d-none'); + expect(wrapper.find('.gl-card-body').classes()).toContain('d-none'); done(); }); }); diff --git a/spec/frontend/monitoring/components/variables/dropdown_field_spec.js b/spec/frontend/monitoring/components/variables/dropdown_field_spec.js index 788f3abf617..cc384aef231 100644 --- a/spec/frontend/monitoring/components/variables/dropdown_field_spec.js +++ b/spec/frontend/monitoring/components/variables/dropdown_field_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { GlDeprecatedDropdown, GlDeprecatedDropdownItem } from '@gitlab/ui'; +import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; import DropdownField from '~/monitoring/components/variables/dropdown_field.vue'; describe('Custom variable component', () => { @@ -23,8 +23,8 @@ describe('Custom variable component', () => { }); }; - const findDropdown = () => wrapper.find(GlDeprecatedDropdown); - const findDropdownItems = () => wrapper.findAll(GlDeprecatedDropdownItem); + const findDropdown = () => wrapper.find(GlDropdown); + const findDropdownItems = () => wrapper.findAll(GlDropdownItem); it('renders dropdown element when all necessary props are passed', () => { createShallowWrapper(); |