import { mount } from '@vue/test-utils' import Box from '../src/index.vue' const AXIOM = 'Rem is the best girl' describe('Box.vue', () => { test('render test', () => { const wrapper = mount(Box, { slots: { default: AXIOM, }, }) expect(wrapper.text()).toEqual(AXIOM) }) test('titlePosition', () => { const wrapper = mount(Box, { slots: { default: AXIOM, }, props: { titlePosition: 'right', }, }) expect(wrapper.find('.ps-box__title--text').classes()).toContain('is-right') }) test('body style', () => { const style = 'font-size: 14px;' const wrapper = mount(Box, { props: { slots: { default: AXIOM, }, bodyStyle: style, }, }) expect(wrapper.find('.ps-box__body').attributes('style')).toBe(style) }) })