30 lines
728 B
TypeScript
30 lines
728 B
TypeScript
import Footer from '@/components/pure/footer/index.vue';
|
|
|
|
import { mount } from '@vue/test-utils';
|
|
import { describe, expect, test } from 'vitest';
|
|
|
|
describe('Footer', () => {
|
|
test('renders the correct text', () => {
|
|
const wrapper = mount(Footer, {
|
|
props: {
|
|
text: 'Custom Text',
|
|
},
|
|
});
|
|
|
|
expect(wrapper.text()).toBe('Custom Text');
|
|
});
|
|
|
|
test('renders the default text if no prop is provided', () => {
|
|
const wrapper = mount(Footer);
|
|
|
|
expect(wrapper.text()).toBe('MeterSphere');
|
|
});
|
|
|
|
test('applies the correct styles', () => {
|
|
const wrapper = mount(Footer);
|
|
|
|
expect(wrapper.find('.footer').exists()).toBe(true);
|
|
expect(wrapper.classes()).toContain('footer');
|
|
});
|
|
});
|