import { mount } from '@vue/test-utils'; import Flex from '..'; import mountTest from '../../../tests/shared/mountTest'; describe('Flex', () => { mountTest(Flex); it('Flex', () => { const wrapper = mount({ render() { return test; }, }); const wrapper2 = mount({ render() { return test; }, }); expect(wrapper.classes('ant-flex')).toBeTruthy(); expect(wrapper.find('.ant-flex-justify-center')).toBeTruthy(); expect(wrapper2.classes('ant-flex')).toBeTruthy(); expect(wrapper2.element.style.gap).toBe('100px'); }); it('Component work', () => { const wrapper = mount({ render() { return test; }, }); const wrapper2 = mount({ render() { return test; }, }); expect(wrapper.find('.ant-flex').element.tagName).toBe('DIV'); expect(wrapper2.find('.ant-flex').element.tagName).toBe('SPAN'); }); it('when vertical=true should stretch work', () => { const wrapper = mount({ render() { return test; }, }); const wrapper2 = mount({ render() { return ( test ); }, }); expect(wrapper.find('.ant-flex-align-stretch')).toBeTruthy(); expect(wrapper2.find('.ant-flex-align-center')).toBeTruthy(); }); });