mirror of
https://github.com/hanzoai/vitest.git
synced 2026-09-24 17:04:25 +00:00
27 lines
707 B
Vue
27 lines
707 B
Vue
<script setup lang="ts">
|
|
import type { TestAttachment } from 'vitest'
|
|
import { computed } from 'vue'
|
|
import { internalOrExternalUrl, isExternalAttachment } from '~/composables/attachments'
|
|
import VisualRegressionImageContainer from './VisualRegressionImageContainer.vue'
|
|
|
|
const { attachment } = defineProps<{
|
|
attachment: TestAttachment
|
|
}>()
|
|
|
|
const href = computed<string>(() => internalOrExternalUrl(attachment))
|
|
</script>
|
|
|
|
<template>
|
|
<VisualRegressionImageContainer>
|
|
<a
|
|
target="_blank"
|
|
:href="href"
|
|
:referrerPolicy="isExternalAttachment(attachment) ? 'no-referrer' : undefined"
|
|
>
|
|
<img
|
|
:src="href"
|
|
>
|
|
</a>
|
|
</VisualRegressionImageContainer>
|
|
</template>
|