Skip to content

Commit 1a5aa54

Browse files
committed
test: tests for inheritAttrs option component option works with ssr (vuejs#11297)
1 parent f7d8597 commit 1a5aa54

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/ssr/ssr-string.spec.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,31 @@ describe('SSR: renderToString', () => {
16131613
done()
16141614
})
16151615
})
1616+
1617+
it('Options inheritAttrs in parent component', done => {
1618+
const childComponent = {
1619+
template: `<div>{{ someProp }}</div>`,
1620+
props: {
1621+
someProp: {}
1622+
},
1623+
}
1624+
const parentComponent = {
1625+
template: `<childComponent v-bind="$attrs" />`,
1626+
components: { childComponent },
1627+
inheritAttrs: false
1628+
}
1629+
renderVmWithOptions({
1630+
template: `
1631+
<div>
1632+
<parentComponent some-prop="some-val" />
1633+
</div>
1634+
`,
1635+
components: { parentComponent }
1636+
}, result => {
1637+
expect(result).toContain('<div data-server-rendered="true"><div>some-val</div></div>')
1638+
done()
1639+
})
1640+
})
16161641
})
16171642

16181643
function renderVmWithOptions (options, cb) {

0 commit comments

Comments
 (0)