2023-06-01 14:14:55 +08:00
|
|
|
import { mount } from '@vue/test-utils';
|
|
|
|
import { describe, expect, test } from 'vitest';
|
2023-06-08 14:28:53 +08:00
|
|
|
import Footer from '@/components/pure/footer/index.vue';
|
2023-06-01 14:14:55 +08:00
|
|
|
|
|
|
|
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');
|
|
|
|
});
|
|
|
|
});
|