Open
Description
I have some problem with importing component I have test file in the same folder as component.
BlogPost.spec.ts
import 'jest';
import { shallowMount } from '@vue/test-utils';
import BlogPost from './BlogPost.vue';
describe('BlogPost Component', () => {
it('Displaying posts from data', () => {
const title = 'New Title';
const wrapper = shallowMount(BlogPost, {
propsData: { title },
});
expect(wrapper.text()).toMatch(title);
});
});
BlogPost.vue
<template>
<div class="d-flex flex-column align-center">
<div class="rounded-xl blog-post">
<v-row>
<v-col>
<div class="d-flex justify-center">
<h1>{{ title }}</h1>
</div>
<div class="d-flex justify-center">
<v-img :src="image" />
</div>
<div class="d-flex justify-center">
{{ description }}
</div>
</v-col>
</v-row>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
name: 'BlogPost',
props: {
title: String,
image: String,
description: String,
date: Date,
},
});
</script>
Metadata
Metadata
Assignees
Labels
No labels