@@ -54,7 +54,7 @@ describe('VueLink', () => {
54
54
expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
55
55
expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
56
56
57
- expect ( wrapper . html ( ) ) . toBe ( '<a href="http://example.com/"><div>Hi</div></a>' )
57
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
58
58
} )
59
59
it ( 'does trigger external on https link' , ( ) => {
60
60
const wrapper = mount ( VueLink , {
@@ -76,7 +76,7 @@ describe('VueLink', () => {
76
76
expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
77
77
expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
78
78
79
- expect ( wrapper . html ( ) ) . toBe ( '<a href="https://example.com/"><div>Hi</div></a>' )
79
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
80
80
} )
81
81
it ( 'does trigger external on // link' , ( ) => {
82
82
const wrapper = mount ( VueLink , {
@@ -98,7 +98,7 @@ describe('VueLink', () => {
98
98
expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
99
99
expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
100
100
101
- expect ( wrapper . html ( ) ) . toBe ( '<a href="//example.com/"><div>Hi</div></a>' )
101
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
102
102
} )
103
103
it ( 'does trigger external on external prop set' , ( ) => {
104
104
const wrapper = mount ( VueLink , {
@@ -121,7 +121,7 @@ describe('VueLink', () => {
121
121
expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
122
122
expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
123
123
124
- expect ( wrapper . html ( ) ) . toBe ( '<a href="/far-away"><div>Hi</div></a>' )
124
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
125
125
} )
126
126
it ( 'does set rel correctly' , ( ) => {
127
127
const wrapper = mount ( VueLink , {
@@ -144,7 +144,7 @@ describe('VueLink', () => {
144
144
expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
145
145
expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
146
146
147
- expect ( wrapper . html ( ) ) . toBe ( '<a href="http://example.com" rel="nofollow"><div>Hi</div></a>' )
147
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
148
148
} )
149
149
it ( 'does set target on newTab correctly' , ( ) => {
150
150
const wrapper = mount ( VueLink , {
@@ -167,7 +167,7 @@ describe('VueLink', () => {
167
167
expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
168
168
expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
169
169
170
- expect ( wrapper . html ( ) ) . toBe ( '<a href="http://example.com" target="_blank"><div>Hi</div></a>' )
170
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
171
171
} )
172
172
it ( 'does set target on prop correctly' , ( ) => {
173
173
const wrapper = mount ( VueLink , {
@@ -190,7 +190,7 @@ describe('VueLink', () => {
190
190
expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
191
191
expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
192
192
193
- expect ( wrapper . html ( ) ) . toBe ( '<a href="https://example.com" target="_parent"><div>Hi</div></a>' )
193
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
194
194
} )
195
195
it ( 'does not bind href if unset' , ( ) => {
196
196
const wrapper = mount ( VueLink , {
@@ -207,7 +207,7 @@ describe('VueLink', () => {
207
207
expect ( wrapper . isVueInstance ( ) ) . toBe ( false )
208
208
expect ( wrapper . contains ( RouterLinkStub ) ) . toBe ( false )
209
209
210
- expect ( wrapper . html ( ) ) . toBe ( '<a><div>Hi</div></a>' )
210
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
211
211
} )
212
212
} )
213
213
} )
0 commit comments