Skip to content

Commit

Permalink
fix: change event incorrecty emits false
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusBorg authored Apr 11, 2019
1 parent db6ff34 commit 136da33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/portal-target.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default Vue.extend({
},
watch: {
ownTransports() {
this.$emit('change', this.children().length > 1)
this.$emit('change', this.children().length > 0)
},
name(newVal, oldVal) {
/**
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/specs/portal-target.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('PortalTarget', function() {
it('emits change event', function() {
const wrapper = createWrapper()

const vNodes = Object.freeze([generateVNode()[0], generateVNode()[0]])
const vNodes = Object.freeze([generateVNode()[0]])
Vue.set(Wormhole.transports, 'target', [
{
to: 'target',
Expand All @@ -94,7 +94,7 @@ describe('PortalTarget', function() {
])

return Vue.nextTick().then(() => {
expect(wrapper.emitted().change[0][0]).toEqual(expect.any(Boolean))
expect(wrapper.emitted().change[0][0]).toBe(true)
})
})

Expand Down

0 comments on commit 136da33

Please sign in to comment.