diff options
Diffstat (limited to 'spec/frontend/monitoring/components/charts/empty_chart_spec.js')
-rw-r--r-- | spec/frontend/monitoring/components/charts/empty_chart_spec.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/frontend/monitoring/components/charts/empty_chart_spec.js b/spec/frontend/monitoring/components/charts/empty_chart_spec.js new file mode 100644 index 00000000000..06822126b59 --- /dev/null +++ b/spec/frontend/monitoring/components/charts/empty_chart_spec.js @@ -0,0 +1,33 @@ +import { shallowMount, createLocalVue } from '@vue/test-utils'; +import EmptyChart from '~/monitoring/components/charts/empty_chart.vue'; + +const localVue = createLocalVue(); + +describe('Empty Chart component', () => { + let emptyChart; + const graphTitle = 'Memory Usage'; + + beforeEach(() => { + emptyChart = shallowMount(localVue.extend(EmptyChart), { + propsData: { + graphTitle, + }, + sync: false, + localVue, + }); + }); + + afterEach(() => { + emptyChart.destroy(); + }); + + it('render the chart title', () => { + expect(emptyChart.find({ ref: 'graphTitle' }).text()).toBe(graphTitle); + }); + + describe('Computed props', () => { + it('sets the height for the svg container', () => { + expect(emptyChart.vm.svgContainerStyle.height).toBe('300px'); + }); + }); +}); |