Skip to content

Commit 2789185

Browse files
author
Pierre Trollé
committed
insertion of ClickMeButton inside Hello.vue
1 parent c1731f7 commit 2789185

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/components/Hello.vue

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div class="hello">
3+
<click-me-button></click-me-button>
34
<div class="counter">{{ counter }}</div>
45
<h1>{{ msg }}</h1>
56
<h2>Essential Links</h2>
@@ -22,14 +23,18 @@
2223
</template>
2324

2425
<script>
26+
import ClickMeButton from '../components/ClickMeButton'
2527
export default {
26-
name: 'hello',
27-
data () {
28-
return {
29-
msg: 'Welcome to Your Vue.js App',
30-
counter: 0
28+
name: 'hello',
29+
components: {
30+
ClickMeButton
31+
},
32+
data () {
33+
return {
34+
msg: 'Welcome to Your Vue.js App',
35+
counter: 0
36+
}
3137
}
32-
}
3338
}
3439
</script>
3540

test/unit/specs/Hello.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Vue from 'vue'
2+
import ClickMeButton from '@/components/ClickMeButton'
23
import Hello from '@/components/Hello'
34

45
describe('Hello.vue', () => {
@@ -54,4 +55,9 @@ describe('Hello.vue', () => {
5455
it('should check the name of my vue', () => {
5556
expect(vm.$options.name).to.equal('hello')
5657
})
58+
59+
it('should include a clickMeButton', () => {
60+
const clickMeButton = vm.$options.components.ClickMeButton
61+
expect(clickMeButton).to.contain(ClickMeButton)
62+
})
5763
})

0 commit comments

Comments
 (0)