From 07fcb3db01aea6fc3a704f24118218b17f5151d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Thu, 10 Mar 2022 13:38:50 +0300 Subject: [PATCH] Create DataViewLayoutOptions.spec.js --- .../DataViewLayoutOptions.spec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/components/dataviewlayoutoptions/DataViewLayoutOptions.spec.js diff --git a/src/components/dataviewlayoutoptions/DataViewLayoutOptions.spec.js b/src/components/dataviewlayoutoptions/DataViewLayoutOptions.spec.js new file mode 100644 index 000000000..28019c8ec --- /dev/null +++ b/src/components/dataviewlayoutoptions/DataViewLayoutOptions.spec.js @@ -0,0 +1,19 @@ +import { mount } from '@vue/test-utils'; +import DataViewLayoutOptions from './DataViewLayoutOptions.vue'; + +describe('DataViewLayoutOptions.vue', () => { + it('should exist', async () => { + const wrapper = mount(DataViewLayoutOptions, { + props: { + modelValue: 'grid' + } + }); + + expect(wrapper.find('.p-dataview-layout-options').exists()).toBe(true); + expect(wrapper.find('.p-highlight > .pi-th-large').exists()).toBe(true); + + wrapper.vm.$emit('update:modelValue', 'list'); + + expect(wrapper.emitted()['update:modelValue'][0]).toEqual(['list']); + }); +}); \ No newline at end of file