Skip to content

Commit

Permalink
Hello.vue calls ClickMeButton with props
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Trollé committed May 15, 2017
1 parent 2789185 commit 1c20a6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Hello.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="hello">
<click-me-button></click-me-button>
<click-me-button message="Increment counter"></click-me-button>
<div class="counter">{{ counter }}</div>
<h1>{{ msg }}</h1>
<h2>Essential Links</h2>
Expand Down
9 changes: 9 additions & 0 deletions test/unit/specs/Hello.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,13 @@ describe('Hello.vue', () => {
const clickMeButton = vm.$options.components.ClickMeButton
expect(clickMeButton).to.contain(ClickMeButton)
})

it('should define a message to put inside the clickMeButton', () => {
expect(vm.$options.components.ClickMeButton.props).to.haveOwnProperty('message')
})

it('should verify textContent of the Click Me Button', () => {
expect(vm.$el.querySelector('.clickMeButton button').textContent)
.to.equal('Increment counter')
})
})

0 comments on commit 1c20a6f

Please sign in to comment.