primevue-mirror/components/breadcrumb/Breadcrumb.spec.js

30 lines
990 B
JavaScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { mount } from '@vue/test-utils';
import Breadcrumb from './Breadcrumb.vue';
describe('Breadcrumb', () => {
it('should exist', () => {
const wrapper = mount(Breadcrumb, {
global: {
2022-12-08 11:04:25 +00:00
stubs: {
'router-link': true
},
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
});