-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { describe, expect, it } from 'vitest' | ||
import { mockComponent, mountSuspended } from 'vitest-environment-nuxt/utils' | ||
import ProductCard from '~/components/product/ProductCard.vue' | ||
|
||
mockComponent('ProductCard', async () => { | ||
const { h } = await import('vue') | ||
return { | ||
setup() { | ||
return () => h('div', null, 'Mocked') | ||
}, | ||
} | ||
}) | ||
|
||
describe('ProductCard.vue', () => { | ||
it('can mount some component', async () => { | ||
const component = await mountSuspended(ProductCard, { | ||
props: { | ||
title: 'Test title', | ||
description: 'Test description', | ||
category: 'Test category', | ||
image: 'Test image', | ||
}, | ||
}) | ||
|
||
expect(component.text()).toContain('Test title') | ||
expect(component.text()).toContain('Test description') | ||
expect(component.text()).toContain('Test category') | ||
}) | ||
}) |
2fa5773
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for morpheme-nuxt-starter ready!
✅ Preview
https://morpheme-nuxt-starter-f77el9plm-gravitano.vercel.app
Built with commit 2fa5773.
This pull request is being automatically deployed with vercel-action