Vue3 + Jest + TextBoxComponent [TypeError: e is not a function]

Hi,
we cannot get out test running after replacing our previous controls through to Syncfusion controls.
Please check the example. We already mocked missing functions but minifying makes all debugging almost impossible.

input.spec.ts
import { mount } from '@vue/test-utils'

import input from '../../../../src/components/input.vue'
describe('input', () => {
    it('Get initial value from formStore', async () => {
        Object.defineProperty(window, 'crypto', {
            value: { getRandomValues: jest.fn().mockReturnValueOnce(new Uint32Array(10)) }
        })
        const wrapper = mount(input, {
        })
    })
})


input.vue
<template>
        <TextBoxComponent
            floatLabelType="Auto"/>
</template>

<script setup lang="ts">
    import { TextBoxComponent } from '@syncfusion/ej2-vue-inputs'
</script>

Screenshot 2022-08-10 164534.png

I have simplified my example above.


3 Replies

GM Gordon M August 11, 2022 12:28 PM UTC

After further debugging, it seems the error is coming from the minified version of the control.

I found a (not really nice) solution when using the original source of the control. I still had to change the test framework from Jest to Vitest. But here it seems the control is finally rendering.


import { TextBoxComponent } from '@syncfusion/ej2-vue-inputs/textbox
(in input.vue)



VJ Vinitha Jeyakumar Syncfusion Team August 11, 2022 02:29 PM UTC

Hi Gordon,

Currently, we are validating your reported query. we will update you the further details in two business days on or before 16th August 2022.

Regards,
Vinitha


VJ Vinitha Jeyakumar Syncfusion Team August 17, 2022 09:50 AM UTC

Hi Gordon,


We are glad that you have resolved your reported issue at your end. please get back to us if you face any issues with the vitest test framework.

Regards,
Vinitha

Loader.
Up arrow icon