Skip to content

Commit f3a1e22

Browse files
committed
refactor: minor changes
1 parent 9ea0664 commit f3a1e22

File tree

7 files changed

+31
-17
lines changed

7 files changed

+31
-17
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@
3737
"vuex": "^3.1.2"
3838
},
3939
"devDependencies": {
40+
"@babel/core": "^7.8.3",
4041
"@vue/cli-plugin-babel": "^4.1.2",
4142
"@vue/cli-plugin-e2e-nightwatch": "^4.1.2",
4243
"@vue/cli-plugin-eslint": "^4.1.2",
4344
"@vue/cli-plugin-unit-jest": "^4.1.2",
4445
"@vue/cli-service": "^4.1.2",
4546
"@vue/test-utils": "1.0.0-beta.29",
46-
"@babel/core": "^7.8.3",
4747
"babel-eslint": "^10.0.3",
4848
"babel-jest": "^25.1.0",
49-
"core-js": "^3.6.4",
5049
"chromedriver": "^79.0.2",
50+
"core-js": "^3.6.4",
5151
"eslint": "^6.8.0",
52-
"eslint-plugin-vue": "^6.1.2",
52+
"eslint-plugin-vue": "^6.2.1",
5353
"node-sass": "^4.13.1",
5454
"npm-run-all": "^4.1.5",
5555
"sass-loader": "^8.0.2",

src/containers/TheFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<CFooter>
2+
<CFooter :fixed="false">
33
<div>
44
<a href="https://coreui.io" target="_blank">CoreUI</a>
55
<span class="ml-1">&copy; 2020 creativeLabs.</span>

src/views/base/Tabs.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
2626
officia deserunt mollit anim id est laborum.
2727
</CTab>
28-
<CTab title="Profile">
28+
<CTab title="Profile" active>
2929
2. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
3030
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
3131
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
@@ -81,7 +81,7 @@
8181
Tabs with icons
8282
</CCardHeader>
8383
<CCardBody>
84-
<CTabs>
84+
<CTabs :active-tab.sync="activeTab">
8585
<CTab active>
8686
<template slot="title">
8787
<CIcon name="cil-calculator"/>
@@ -123,7 +123,7 @@
123123
</CCardHeader>
124124
<CCardBody>
125125
<CTabs add-tab-classes="mt-1">
126-
<CTab active>
126+
<CTab>
127127
<template slot="title">
128128
<CIcon name="cil-calculator"/> {{tabs[0]}}
129129
</template>
@@ -133,7 +133,7 @@
133133
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
134134
officia deserunt mollit anim id est laborum.
135135
</CTab>
136-
<CTab>
136+
<CTab active>
137137
<template slot="title">
138138
<CIcon name="cil-basket"/> {{tabs[1]}}
139139
</template>
@@ -211,7 +211,8 @@ export default {
211211
'Calculator',
212212
'Shopping cart',
213213
'Charts'
214-
]
214+
],
215+
activeTab: 1
215216
}
216217
}
217218
}

tests/unit/containers/TheContainer.spec.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,39 @@
11
import CoreuiVue from '@coreui/vue'
22
import { shallowMount, createLocalVue } from '@vue/test-utils';
33
import VueRouter from 'vue-router'
4+
import Vuex from 'vuex'
45
import TheContainer from '@/containers/TheContainer'
56

67
const localVue = createLocalVue()
8+
localVue.use(Vuex)
79
localVue.use(VueRouter)
8-
const router = new VueRouter()
9-
1010
localVue.use(CoreuiVue)
11+
const store = new Vuex.Store({
12+
state: {
13+
darkMode: false,
14+
sidebarShow: 'responsive',
15+
sidebarMinimize: false,
16+
asideShow: false
17+
}
18+
})
19+
20+
const router = new VueRouter()
1121

1222
describe('TheContainer.vue', () => {
1323
it('has a name', () => {
1424
expect(TheContainer.name).toBe('TheContainer')
1525
})
1626
test('renders correctly', () => {
1727
const wrapper = shallowMount(TheContainer, {
28+
store,
1829
localVue,
19-
router
30+
router
2031
})
2132
expect(wrapper.element).toMatchSnapshot()
2233
})
2334
it('is Vue instance', () => {
2435
const wrapper = shallowMount(TheContainer, {
36+
store,
2537
localVue,
2638
router
2739
})

tests/unit/containers/__snapshots__/TheFooter.spec.js.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
exports[`TheFooter.vue renders correctly 1`] = `
44
<cfooter-stub
5-
fixed="true"
65
tag="footer"
76
>
87
<div>

tests/unit/views/base/__snapshots__/Tabs.spec.js.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ exports[`Tabs.vue renders correctly 1`] = `
5858
</ctab-stub>
5959
6060
<ctab-stub
61+
active="true"
6162
activeclass="router-link-active"
6263
event="click"
6364
exactactiveclass="router-link-exact-active"
@@ -184,6 +185,7 @@ exports[`Tabs.vue renders correctly 1`] = `
184185
185186
<ccardbody-stub>
186187
<ctabs-stub
188+
activetab="1"
187189
fade="true"
188190
variant="tabs"
189191
>
@@ -274,7 +276,6 @@ exports[`Tabs.vue renders correctly 1`] = `
274276
variant="tabs"
275277
>
276278
<ctab-stub
277-
active="true"
278279
activeclass="router-link-active"
279280
event="click"
280281
exactactiveclass="router-link-exact-active"
@@ -298,6 +299,7 @@ exports[`Tabs.vue renders correctly 1`] = `
298299
</ctab-stub>
299300
300301
<ctab-stub
302+
active="true"
301303
activeclass="router-link-active"
302304
event="click"
303305
exactactiveclass="router-link-exact-active"

0 commit comments

Comments
 (0)