@@ -54,7 +54,7 @@ describe('VueLink', () => {
5454 expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
5555 expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
5656
57- expect ( wrapper . html ( ) ) . toBe ( '<a href="http://example.com/"><div>Hi</div></a>' )
57+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
5858 } )
5959 it ( 'does trigger external on https link' , ( ) => {
6060 const wrapper = mount ( VueLink , {
@@ -76,7 +76,7 @@ describe('VueLink', () => {
7676 expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
7777 expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
7878
79- expect ( wrapper . html ( ) ) . toBe ( '<a href="https://example.com/"><div>Hi</div></a>' )
79+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
8080 } )
8181 it ( 'does trigger external on // link' , ( ) => {
8282 const wrapper = mount ( VueLink , {
@@ -98,7 +98,7 @@ describe('VueLink', () => {
9898 expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
9999 expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
100100
101- expect ( wrapper . html ( ) ) . toBe ( '<a href="//example.com/"><div>Hi</div></a>' )
101+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
102102 } )
103103 it ( 'does trigger external on external prop set' , ( ) => {
104104 const wrapper = mount ( VueLink , {
@@ -121,7 +121,7 @@ describe('VueLink', () => {
121121 expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
122122 expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
123123
124- expect ( wrapper . html ( ) ) . toBe ( '<a href="/far-away"><div>Hi</div></a>' )
124+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
125125 } )
126126 it ( 'does set rel correctly' , ( ) => {
127127 const wrapper = mount ( VueLink , {
@@ -144,7 +144,7 @@ describe('VueLink', () => {
144144 expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
145145 expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
146146
147- expect ( wrapper . html ( ) ) . toBe ( '<a href="http://example.com" rel="nofollow"><div>Hi</div></a>' )
147+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
148148 } )
149149 it ( 'does set target on newTab correctly' , ( ) => {
150150 const wrapper = mount ( VueLink , {
@@ -167,7 +167,7 @@ describe('VueLink', () => {
167167 expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
168168 expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
169169
170- expect ( wrapper . html ( ) ) . toBe ( '<a href="http://example.com" target="_blank"><div>Hi</div></a>' )
170+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
171171 } )
172172 it ( 'does set target on prop correctly' , ( ) => {
173173 const wrapper = mount ( VueLink , {
@@ -190,7 +190,7 @@ describe('VueLink', () => {
190190 expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
191191 expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
192192
193- expect ( wrapper . html ( ) ) . toBe ( '<a href="https://example.com" target="_parent"><div>Hi</div></a>' )
193+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
194194 } )
195195 it ( 'does not bind href if unset' , ( ) => {
196196 const wrapper = mount ( VueLink , {
@@ -207,7 +207,7 @@ describe('VueLink', () => {
207207 expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
208208 expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
209209
210- expect ( wrapper . html ( ) ) . toBe ( '<a><div>Hi</div></a>' )
210+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
211211 } )
212212 } )
213213} )
0 commit comments