-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
39 additions
and
7 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
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,38 @@ | ||
import { describe, it, expect } from 'vitest' | ||
import { mount } from '@vue/test-utils' | ||
|
||
import BreadCrumb from '../BreadCrumb.vue' | ||
import { createVuetify } from 'vuetify' | ||
import * as components from 'vuetify/components' | ||
import * as directives from 'vuetify/directives' | ||
|
||
const vuetify = createVuetify({ | ||
components, | ||
directives | ||
}) | ||
|
||
describe('BreadCrumb.vue', () => { | ||
const wrapper = mount(BreadCrumb, { | ||
global: { | ||
plugins: [vuetify] | ||
}, | ||
propsData: { | ||
title: 'TITLE', | ||
itemName: 'ItemName' | ||
} | ||
}) | ||
|
||
it('renders the breadcrumb title correctly', async () => { | ||
const title = wrapper.get('.v-breadcrumbs__prepend h2').text() | ||
|
||
expect(title).toBe('TITLE') | ||
}) | ||
|
||
it('renders the breadcrumb items correctly', async () => { | ||
const breadCrumbItems = wrapper.findAllComponents('.v-breadcrumbs-item') | ||
|
||
expect(breadCrumbItems).length(2) | ||
expect(breadCrumbItems[0].text()).toBe('Home') | ||
expect(breadCrumbItems[1].text()).toBe('ItemName') | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
<script setup lang="ts"> | ||
import BreadCrumb from '@/components/BreadCrumb.vue' | ||
</script> | ||
|
||
<template> | ||
|