diff --git a/spec/javascripts/fixtures/environments.rb b/spec/javascripts/fixtures/environments.rb deleted file mode 100644 index d2457d75419..00000000000 --- a/spec/javascripts/fixtures/environments.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'spec_helper' - -describe Projects::EnvironmentsController, '(JavaScript fixtures)', type: :controller do - include JavaScriptFixturesHelpers - - let(:admin) { create(:admin) } - let(:namespace) { create(:namespace, name: 'frontend-fixtures' )} - let(:project) { create(:project_empty_repo, namespace: namespace, path: 'environments-project') } - let(:environment) { create(:environment, name: 'production', project: project) } - - render_views - - before(:all) do - clean_frontend_fixtures('environments/metrics') - end - - before do - sign_in(admin) - end - - it 'environments/metrics/metrics.html.raw' do |example| - get :metrics, - namespace_id: project.namespace, - project_id: project, - id: environment.id - - expect(response).to be_success - store_frontend_fixture(response, example.description) - end -end diff --git a/spec/javascripts/monitoring/dashboard_spec.js b/spec/javascripts/monitoring/dashboard_spec.js index 4c5a10393c6..39de6f1bba6 100644 --- a/spec/javascripts/monitoring/dashboard_spec.js +++ b/spec/javascripts/monitoring/dashboard_spec.js @@ -5,7 +5,6 @@ import axios from '~/lib/utils/axios_utils'; import { metricsGroupsAPIResponse, mockApiEndpoint } from './mock_data'; describe('Dashboard', () => { - const fixtureName = 'environments/metrics/metrics.html.raw'; let DashboardComponent; const propsData = { @@ -22,21 +21,19 @@ describe('Dashboard', () => { emptyUnableToConnectSvgPath: '/path/to/unable-to-connect.svg', }; - preloadFixtures(fixtureName); - beforeEach(() => { - loadFixtures(fixtureName); + setFixtures('
'); DashboardComponent = Vue.extend(Dashboard); }); describe('no metrics are available yet', () => { it('shows a getting started empty state when no metrics are present', () => { const component = new DashboardComponent({ - el: document.querySelector('#prometheus-graphs'), + el: document.querySelector('.prometheus-graphs'), propsData, }); - expect(component.$el.querySelector('#prometheus-graphs')).toBe(null); + expect(component.$el.querySelector('.prometheus-graphs')).toBe(null); expect(component.state).toEqual('gettingStarted'); }); }); @@ -54,7 +51,7 @@ describe('Dashboard', () => { it('shows up a loading state', (done) => { const component = new DashboardComponent({ - el: document.querySelector('#prometheus-graphs'), + el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, hasMetrics: true }, }); @@ -66,7 +63,7 @@ describe('Dashboard', () => { it('hides the legend when showLegend is false', (done) => { const component = new DashboardComponent({ - el: document.querySelector('#prometheus-graphs'), + el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, hasMetrics: true, showLegend: false }, }); @@ -80,7 +77,7 @@ describe('Dashboard', () => { it('hides the group panels when showPanels is false', (done) => { const component = new DashboardComponent({ - el: document.querySelector('#prometheus-graphs'), + el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, hasMetrics: true, showPanels: false }, });