Skip to content

Commit ac37805

Browse files
author
Antoine de Chevigné
committed
alternative link test
1 parent 7b16c49 commit ac37805

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/unit/components/HashLink.spec.js

+21
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,25 @@ describe('HashLink.vue', () => {
303303

304304
expect(wrapper.html()).toMatchSnapshot();
305305
});
306+
307+
it('Should display alternative link switch', async () => {
308+
const pinia = getPiniaInstance({
309+
initialState: {},
310+
mockAlternateLink: 'alternateLink'
311+
});
312+
313+
const wrapper = mount(HashLink, {
314+
global: {
315+
plugins: [pinia]
316+
},
317+
props: {
318+
type: 'address',
319+
fullHash: true,
320+
hash: '0xed5af388653567af2f388e6224dc7c4b3241c544'
321+
}
322+
});
323+
await flushPromises();
324+
325+
expect(wrapper.html()).toMatchSnapshot();
326+
});
306327
});

tests/unit/components/__snapshots__/HashLink.spec.js.snap

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ exports[`HashLink.vue > Should display a shortened link to the address 1`] = `
1212
<!--v-if--></span>"
1313
`;
1414
15+
exports[`HashLink.vue > Should display alternative link switch 1`] = `
16+
"<span><!--v-if--><a>0xed5af388653567af2f388e6224dc7c4b3241c544</a><!--v-if--><span> &nbsp;<i class="mdi-content-copy mdi v-icon notranslate v-theme--light v-icon--size-x-small v-icon--clickable text-medium-emphasis" role="button" aria-hidden="false" tabindex="0"></i><input type="hidden" id="copyElement-0xed5af388653567af2f388e6224dc7c4b3241c544" value="0xed5af388653567af2f388e6224dc7c4b3241c544"></span>
17+
<!--v-if--><span> &nbsp; <i class="mdi-swap-horizontal mdi v-icon notranslate v-theme--light v-icon--size-x-small v-icon--clickable text-medium-emphasis" role="button" aria-hidden="false" tabindex="0"></i></span></span>"
18+
`;
19+
1520
exports[`HashLink.vue > Should display an external link if embedded 1`] = `
1621
"<span><!--v-if--><a href="//explorer.tryethernal.com/address/0xed5af388653567af2f388e6224dc7c4b3241c544" target="_blank">0xed5af3...c544</a><!--v-if--><span> &nbsp;<i class="mdi-content-copy mdi v-icon notranslate v-theme--light v-icon--size-x-small v-icon--clickable text-medium-emphasis" role="button" aria-hidden="false" tabindex="0"></i><input type="hidden" id="copyElement-0xed5af388653567af2f388e6224dc7c4b3241c544" value="0xed5af388653567af2f388e6224dc7c4b3241c544"></span>
1722
<!--v-if-->

0 commit comments

Comments
 (0)