importVuefrom'vue';importrenderMetricsfrom'~/behaviors/markdown/render_metrics';import{TEST_HOST}from'helpers/test_constants';constoriginalExtend=Vue.extend;describe('Render metrics for Gitlab Flavoured Markdown',()=>{constcontainer={Metrics(){},};letspyExtend;beforeEach(()=>{Vue.extend=()=>container.Metrics;spyExtend=jest.spyOn(Vue,'extend');});afterEach(()=>{Vue.extend=originalExtend;});it('does nothing when no elements are found',()=>{renderMetrics([]);expect(spyExtend).not.toHaveBeenCalled();});it('renders a vue component when elements are found',()=>{constelement=document.createElement('div');element.setAttribute('data-dashboard-url',TEST_HOST);renderMetrics([element]);expect(spyExtend).toHaveBeenCalled();});});