2022-09-06 12:03:37 +00:00
|
|
|
import { mount } from '@vue/test-utils';
|
|
|
|
import Breadcrumb from './Breadcrumb.vue';
|
2023-08-31 09:46:08 +00:00
|
|
|
import BreadcrumbItem from './BreadcrumbItem.vue';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
describe('Breadcrumb', () => {
|
|
|
|
it('should exist', () => {
|
|
|
|
const wrapper = mount(Breadcrumb, {
|
|
|
|
global: {
|
2022-12-08 11:04:25 +00:00
|
|
|
stubs: {
|
|
|
|
'router-link': true
|
|
|
|
},
|
2023-08-31 09:46:08 +00:00
|
|
|
components: {
|
|
|
|
BreadcrumbItem
|
|
|
|
},
|
2022-12-08 11:04:25 +00:00
|
|
|
mocks: {
|
|
|
|
$router: {
|
|
|
|
currentRoute: {
|
2022-12-08 14:13:16 +00:00
|
|
|
path: vi.fn()
|
2022-12-08 11:04:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
},
|
|
|
|
props: {
|
2022-09-14 11:26:01 +00:00
|
|
|
home: { icon: 'pi pi-home', to: '/' },
|
|
|
|
model: [{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }]
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
});
|
2022-09-14 11:26:01 +00:00
|
|
|
|
2022-09-06 12:03:37 +00:00
|
|
|
expect(wrapper.find('.p-breadcrumb.p-component').exists()).toBe(true);
|
2022-12-08 11:04:25 +00:00
|
|
|
expect(wrapper.findAll('.p-menuitem-separator').length).toBe(5);
|
2022-09-06 12:03:37 +00:00
|
|
|
expect(wrapper.findAll('.p-menuitem-text').length).toBe(5);
|
|
|
|
});
|
2022-09-14 11:26:01 +00:00
|
|
|
});
|