Closed AlbertLucianto closed 5 years ago
When data is spreaded before all other attributes (href), those attributes will be included in the data after the render.
Below is a related test case:
it('spread (mixed) should not mutate original data', () => { const data = { attrs: { id: 'hehe' } } const vnode = render(h => ( <div {...data} href="huhu" /> )) expect(data.attrs).to.deep.equal({ id: 'hehe' }) })
This yields an error
AssertionError: expected { id: 'hehe', href: 'huhu' } to deeply equal { id: 'hehe' } + expected - actual { - "href": "huhu" "id": "hehe" }
However, it doesn't seem the case when there is at least one attribute before the spread.
When data is spreaded before all other attributes (href), those attributes will be included in the data after the render.
Below is a related test case:
This yields an error
However, it doesn't seem the case when there is at least one attribute before the spread.