diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-15 09:10:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-15 09:10:25 +0300 |
commit | 4b4d8af30ad4a992a5fe538448636fd8aa4d0b6b (patch) | |
tree | c6146eaa803540f5bece71feb9e5f99713598e7c /spec/frontend | |
parent | 0555b45841cefbd64a7bff0d58f7cb3b5bd06d97 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/boards/mock_data.js | 1 | ||||
-rw-r--r-- | spec/frontend/vue_shared/components/memory_graph_spec.js | 18 |
2 files changed, 10 insertions, 9 deletions
diff --git a/spec/frontend/boards/mock_data.js b/spec/frontend/boards/mock_data.js index 0f58d7cf9fa..e5167120542 100644 --- a/spec/frontend/boards/mock_data.js +++ b/spec/frontend/boards/mock_data.js @@ -918,6 +918,7 @@ export const epicBoardListQueryResponse = (totalWeight = 5) => ({ __typename: 'EpicList', id: 'gid://gitlab/Boards::EpicList/3', metadata: { + epicsCount: 1, totalWeight, }, }, diff --git a/spec/frontend/vue_shared/components/memory_graph_spec.js b/spec/frontend/vue_shared/components/memory_graph_spec.js index c3ad6bb8ca6..6fe5830ff49 100644 --- a/spec/frontend/vue_shared/components/memory_graph_spec.js +++ b/spec/frontend/vue_shared/components/memory_graph_spec.js @@ -1,10 +1,8 @@ import { GlSparklineChart } from '@gitlab/ui/dist/charts'; import { shallowMount } from '@vue/test-utils'; -import Vue from 'vue'; import MemoryGraph from '~/vue_shared/components/memory_graph.vue'; describe('MemoryGraph', () => { - const Component = Vue.extend(MemoryGraph); let wrapper; const metrics = [ [1573586253.853, '2.87'], @@ -13,8 +11,10 @@ describe('MemoryGraph', () => { [1573586433.853, '3.0066964285714284'], ]; + const findGlSparklineChart = () => wrapper.findComponent(GlSparklineChart); + beforeEach(() => { - wrapper = shallowMount(Component, { + wrapper = shallowMount(MemoryGraph, { propsData: { metrics, width: 100, @@ -23,19 +23,19 @@ describe('MemoryGraph', () => { }); }); - describe('chartData', () => { - it('should calculate chartData', () => { - expect(wrapper.vm.chartData.length).toEqual(metrics.length); + describe('Chart data', () => { + it('should match metrics length', () => { + expect(findGlSparklineChart().props('data').length).toEqual(metrics.length); }); - it('should format date & MB values', () => { + it('should have formatted date & MB values', () => { const formattedData = [ ['Nov 12 2019 19:17:33', '2.87'], ['Nov 12 2019 19:18:33', '2.78'], ['Nov 12 2019 19:19:33', '2.78'], ['Nov 12 2019 19:20:33', '3.01'], ]; - expect(wrapper.vm.chartData).toEqual(formattedData); + expect(findGlSparklineChart().props('data')).toEqual(formattedData); }); }); @@ -43,7 +43,7 @@ describe('MemoryGraph', () => { it('should draw container with chart', () => { expect(wrapper.element).toMatchSnapshot(); expect(wrapper.find('.memory-graph-container').exists()).toBe(true); - expect(wrapper.findComponent(GlSparklineChart).exists()).toBe(true); + expect(findGlSparklineChart().exists()).toBe(true); }); }); }); |