devextreme-vue
Version:
DevExtreme Vue UI and Visualization Components
44 lines (42 loc) • 1.34 kB
JavaScript
/*!
* devextreme-vue
* Version: 25.1.5
* Build date: Wed Sep 03 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file in the root of the project for details.
*
* https://github.com/DevExpress/devextreme-vue
*/
import { mount } from '@vue/test-utils';
import { defineComponent } from 'vue';
import DxSelectBox from '../../select-box';
import DxTextBox from '../../text-box';
jest.setTimeout(1000);
beforeEach(() => {
jest.clearAllMocks();
});
describe('template rendering', () => {
it('field template rendered', () => {
const vm = defineComponent({
template: `<dx-select-box :data-source="dataSource" field-template="field" id="component">
<template #field="">
<dx-text-box value="text" />
</template>
</dx-select-box >`,
data() {
return {
dataSource: [{ ID: 1 }],
};
},
components: {
DxSelectBox,
DxTextBox,
},
});
const wrapper = mount(vm);
expect(wrapper.getComponent('#component').vm.$el.children).toHaveLength(1);
});
});