primevue-mirror/components/lib/dataviewlayoutoptions/DataViewLayoutOptions.spec.js

33 lines
883 B
JavaScript
Raw Normal View History

2022-12-08 11:04:25 +00:00
import { config, mount } from '@vue/test-utils';
2022-09-06 12:03:37 +00:00
import DataViewLayoutOptions from './DataViewLayoutOptions.vue';
2022-12-08 11:04:25 +00:00
config.global.mocks = {
$primevue: {
config: {
locale: {
aria: {
listView: 'listView',
gridView: 'gridView'
}
}
}
}
};
2022-09-06 12:03:37 +00:00
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);
2022-09-14 11:26:01 +00:00
2022-09-06 12:03:37 +00:00
wrapper.vm.$emit('update:modelValue', 'list');
expect(wrapper.emitted()['update:modelValue'][0]).toEqual(['list']);
});
2022-09-14 11:26:01 +00:00
});