summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-02-15 11:56:56 -0600
committerMike Greiling <mike@pixelcog.com>2018-02-15 11:56:56 -0600
commit533afcb974e5390fc9b573560462a585fcfb461a (patch)
treedd39269128ed08e1b954422eded155edf402bbde
parent08281087b49c552b1463429dcd190adc0df5f077 (diff)
downloadgitlab-ce-42783-create-vue-mount-method.tar.gz
add missing props to Dashboard component test42783-create-vue-mount-method
-rw-r--r--spec/javascripts/monitoring/dashboard_spec.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/javascripts/monitoring/dashboard_spec.js b/spec/javascripts/monitoring/dashboard_spec.js
index eb8f6bbe50d..79924a5f3a8 100644
--- a/spec/javascripts/monitoring/dashboard_spec.js
+++ b/spec/javascripts/monitoring/dashboard_spec.js
@@ -8,6 +8,20 @@ describe('Dashboard', () => {
const fixtureName = 'environments/metrics/metrics.html.raw';
let DashboardComponent;
let component;
+ const propsData = {
+ hasMetrics: 'false',
+ documentationPath: '/path/to/docs',
+ settingsPath: '/path/to/settings',
+ clustersPath: '/path/to/clusters',
+ tagsPath: '/path/to/tags',
+ projectPath: '/path/to/project',
+ metricsEndpoint: mockApiEndpoint,
+ deploymentEndpoint: '/endpoint/deployments',
+ emptyGettingStartedSvgPath: '/path/to/getting-started.svg',
+ emptyLoadingSvgPath: '/path/to/loading.svg',
+ emptyUnableToConnectSvgPath: '/path/to/unable-to-connect.svg',
+ };
+
preloadFixtures(fixtureName);
beforeEach(() => {
@@ -19,6 +33,7 @@ describe('Dashboard', () => {
it('shows a getting started empty state when no metrics are present', () => {
component = new DashboardComponent({
el: document.querySelector('#prometheus-graphs'),
+ propsData,
});
component.$mount();
@@ -30,7 +45,6 @@ describe('Dashboard', () => {
describe('requests information to the server', () => {
let mock;
beforeEach(() => {
- document.querySelector('#prometheus-graphs').setAttribute('data-has-metrics', 'true');
mock = new MockAdapter(axios);
mock.onGet(mockApiEndpoint).reply(200, {
metricsGroupsAPIResponse,
@@ -44,6 +58,7 @@ describe('Dashboard', () => {
it('shows up a loading state', (done) => {
component = new DashboardComponent({
el: document.querySelector('#prometheus-graphs'),
+ propsData: { ...propsData, hasMetrics: 'true' },
});
component.$mount();
Vue.nextTick(() => {