Skip to content

Commit 1c20a6f

Browse files
author
Pierre Trollé
committed
Hello.vue calls ClickMeButton with props
1 parent 2789185 commit 1c20a6f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/components/Hello.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="hello">
3-
<click-me-button></click-me-button>
3+
<click-me-button message="Increment counter"></click-me-button>
44
<div class="counter">{{ counter }}</div>
55
<h1>{{ msg }}</h1>
66
<h2>Essential Links</h2>

test/unit/specs/Hello.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,13 @@ describe('Hello.vue', () => {
6060
const clickMeButton = vm.$options.components.ClickMeButton
6161
expect(clickMeButton).to.contain(ClickMeButton)
6262
})
63+
64+
it('should define a message to put inside the clickMeButton', () => {
65+
expect(vm.$options.components.ClickMeButton.props).to.haveOwnProperty('message')
66+
})
67+
68+
it('should verify textContent of the Click Me Button', () => {
69+
expect(vm.$el.querySelector('.clickMeButton button').textContent)
70+
.to.equal('Increment counter')
71+
})
6372
})

0 commit comments

Comments
 (0)