diff options
author | George Tsiolis <tsiolis.g@gmail.com> | 2018-03-05 19:50:01 +0300 |
---|---|---|
committer | George Tsiolis <tsiolis.g@gmail.com> | 2018-03-08 20:27:47 +0300 |
commit | 910f513ab2b04bf5607213da0a49ce9c5c73bc32 (patch) | |
tree | 1ed536dd75324de733a30e44f1c320d6c5aec53a /spec/javascripts/vue_shared/components | |
parent | 67feb7cd42e439e754d64fce646d8d9fb99a0ad8 (diff) |
Move MemoryGraph and MemoryUsage vue components
Diffstat (limited to 'spec/javascripts/vue_shared/components')
-rw-r--r-- | spec/javascripts/vue_shared/components/memory_graph_spec.js | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/spec/javascripts/vue_shared/components/memory_graph_spec.js b/spec/javascripts/vue_shared/components/memory_graph_spec.js index d46a3f2328e..73a69df019e 100644 --- a/spec/javascripts/vue_shared/components/memory_graph_spec.js +++ b/spec/javascripts/vue_shared/components/memory_graph_spec.js @@ -1,12 +1,12 @@ import Vue from 'vue'; -import memoryGraphComponent from '~/vue_shared/components/memory_graph'; +import MemoryGraph from '~/vue_shared/components/memory_graph.vue'; import { mockMetrics, mockMedian, mockMedianIndex } from './mock_data'; const defaultHeight = '25'; const defaultWidth = '100'; const createComponent = () => { - const Component = Vue.extend(memoryGraphComponent); + const Component = Vue.extend(MemoryGraph); return new Component({ el: document.createElement('div'), @@ -32,29 +32,9 @@ describe('MemoryGraph', () => { el = vm.$el; }); - describe('props', () => { - it('should have props with defaults', (done) => { - const { metrics, deploymentTime, width, height } = memoryGraphComponent.props; - - Vue.nextTick(() => { - const typeClassMatcher = (propItem, expectedType) => { - const PropItemTypeClass = propItem.type; - expect(new PropItemTypeClass() instanceof expectedType).toBeTruthy(); - expect(propItem.required).toBeTruthy(); - }; - - typeClassMatcher(metrics, Array); - typeClassMatcher(deploymentTime, Number); - typeClassMatcher(width, String); - typeClassMatcher(height, String); - done(); - }); - }); - }); - describe('data', () => { it('should have default data', () => { - const data = memoryGraphComponent.data(); + const data = MemoryGraph.data(); const dataValidator = (dataItem, expectedType, defaultVal) => { expect(typeof dataItem).toBe(expectedType); expect(dataItem).toBe(defaultVal); |