From 2023248ee26c7028487324cbba7ccde5266fb684 Mon Sep 17 00:00:00 2001 From: woothu Date: Tue, 9 Oct 2018 14:42:41 +0200 Subject: [PATCH] added widgets from dashboard --- src/views/Dashboard.vue | 223 +++++++++------------------- src/views/widgets/Widget05.vue | 18 +-- src/views/widgets/Widget06.vue | 59 ++++++++ tests/unit/widgets/Widget06.spec.js | 25 ++++ 4 files changed, 160 insertions(+), 165 deletions(-) create mode 100644 src/views/widgets/Widget06.vue create mode 100644 tests/unit/widgets/Widget06.spec.js diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index c4745c67..2b72a6b0 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -2,79 +2,58 @@
- - - - - Action - Another action - Something else here... - Disabled action - -

9.823

-

Members online

-
- -
+ + + + Action + Another action + Something else here... + Disabled action + +
- - - - - Action - Another action - Something else here... - Disabled action - -

9.823

-

Members online

-
- -
+ + + + Action + Another action + Something else here... + Disabled action + +
- - - - - Action - Another action - Something else here... - Disabled action - -

9.823

-

Members online

-
- -
+ + + + Action + Another action + Something else here... + Disabled action + +
- - - - - Action - Another action - Something else here... - Disabled action - -

9.823

-

Members online

-
- -
+ + + + Action + Another action + Something else here... + Disabled action + +
- @@ -124,88 +103,23 @@
- -
-
- -
- -
-
-
-
-
89k
-
friends
-
-
-
459
-
feeds
-
-
-
-
- -
-
- -
- -
-
-
-
-
973k
-
followers
-
-
-
1.792
-
tweets
-
-
-
-
- -
-
- -
- -
-
-
-
-
500+
-
contacts
-
-
-
292
-
feeds
-
-
-
-
- -
-
- -
- -
-
-
-
-
894
-
followers
-
-
-
92
-
circles
-
-
-
-
-
- + + + + + + + + + + + + + @@ -449,26 +363,23 @@ diff --git a/tests/unit/widgets/Widget06.spec.js b/tests/unit/widgets/Widget06.spec.js new file mode 100644 index 00000000..78a87618 --- /dev/null +++ b/tests/unit/widgets/Widget06.spec.js @@ -0,0 +1,25 @@ +import Vue from 'vue' +import { shallowMount } from '@vue/test-utils' +import BootstrapVue from 'bootstrap-vue' +import Component from '@/views/widgets/Widget06' + +Vue.use(BootstrapVue) + +const ComponentName = 'Widget06' +const wrapper = shallowMount(Component) + +describe(ComponentName + '.vue', () => { + it('has a name', () => { + expect(Component.name).toMatch(ComponentName) + }) + it('is Vue instance', () => { + expect(wrapper.isVueInstance()).toBe(true) + }) + it('correctly sets default props and data when created', () => { + expect(wrapper.props().cardClasses).toBe('') + expect(wrapper.props().header).toBe('header|string') + expect(wrapper.props().text).toBe('text|string') + expect(wrapper.props().chartType).toBe('chart1') + expect(wrapper.props().chartHeight == 70).toBe(true) + }) +})