Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAlexLichter committed Mar 14, 2019
1 parent ab4b770 commit e9a456a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
9 changes: 1 addition & 8 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@
"env": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": 8
}
}
]
"@babel/preset-env"
]
}
}
Expand Down
8 changes: 5 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const isExternal = props => !props.to ||

const vueLinkFactory = (slashes, isNuxt) => ({
functional: true,
render: (h, { data, children, props }) => {
render: (h, { data, slots, props }) => {
data.props = props
data.props.slashes = data.props.slashes || slashes

Expand All @@ -46,6 +46,8 @@ const vueLinkFactory = (slashes, isNuxt) => ({

const linkComponent = isNuxt ? 'NuxtLink' : 'RouterLink'

const defaultSlots = slots().default

return isLinkedToExternal
? h('a', {
...data,
Expand All @@ -55,8 +57,8 @@ const vueLinkFactory = (slashes, isNuxt) => ({
rel: data.props.rel || 'noopener',
target: data.props.target || (data.props.newTab ? '_blank' : undefined)
}
}, children)
: h(linkComponent, data, children)
}, defaultSlots)
: h(linkComponent, data, defaultSlots)
}
})

Expand Down
4 changes: 1 addition & 3 deletions test/__snapshots__/VueLink.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ exports[`ForNuxt nuxt-link does apply custom props 1`] = `
</a>
`;

exports[`VueLink external does bind class 1`] = `<a rel="noopener" class="static"><template></template></a>`;

exports[`VueLink external does bind classp 1`] = `
exports[`VueLink external does bind class 1`] = `
<a rel="noopener" class="static">
<div>Hi</div>
</a>
Expand Down

0 comments on commit e9a456a

Please sign in to comment.