Trim not defined jest testing issue.

Showing a error  "Trim not defined jest testing issue". In jest testing library. 


5 Replies

KR Keerthana Rajendran Syncfusion Team July 23, 2021 09:26 AM UTC

Hi Himanshu, 
 
Thanks for contacting Syncfusion support. 
 
Based on the provided details, we are unable to identify the exact case in which you get this error with Jest testcases. Please share your test case code with Chip component in which the error occurs along with a screenshot or video on the issue.  
 
Refer to the following blogs for more details on Jest test cases with Syncfusion components. 
 
 
 
Regards, 
Keerthana. 



HA Himanshu Ahuja July 23, 2021 01:00 PM UTC

import * as React from 'react';

import { ChipListComponent, ChipsDirective, ChipDirective } from '@syncfusion/ej2-react-buttons';

export default class Tags extends React.Component {

  render() {

    return (

      <span data-testid={this.props.testid}>

        <ChipListComponent id="chip-avatar" enableDelete={true}>

          <ChipsDirective>

            <ChipDirective text={this.props.text}></ChipDirective>

          </ChipsDirective>

        </ChipListComponent>

      </span>

    );

  }

}




----------------------------------------------------------------------------------------

import React from 'react';

import { render, screen } from '@testing-library/react';

import Text from './Text';

window.crypto = jest.fn();

window.crypto.getRandomValues = jest.fn();

window.getComputedStyle = (eletm, select) => getComputedStyle(eletm, select);

const { getComputedStyle } = global.window;

render(<Text text="Security" testid="TextTest" iconclass="e-icons e-lock"></Text>);

const TextTest = screen.getByTestId('TextTest');


describe('test 5 - check the rendering', () => {

  it('renders without crashing', () => {

    expect(TextTest).toBeInTheDocument;

  });

});




SM Shalini Maragathavel Syncfusion Team July 26, 2021 12:55 PM UTC

Hi Himanshu,


Thanks for the details.
 
 
Currently, we are validating your query with the provided details at our end. So, we will update further details on July 30th  2021. 
 
Until then, we appreciate your patience. 
 
Regards,
Shalini M.
 
 



KR Keerthana Rajendran Syncfusion Team July 30, 2021 02:32 PM UTC

Hi Himanshu, 
 
We regret for the inconvenience. 
 
We checked the reported scenario with the provided details and able to replicate the issue. Due to complexity, we need some additional time to identify the exact cause and we will update you further details on August 4 , 2021. 
 
Regards, 
Keerthana. 



SS Sharon Sanchez Selvaraj Syncfusion Team August 5, 2021 04:44 PM UTC

Hi Himanshu, 
 
Sorry for the inconvenience. 
 
We have considered the reported issue as a bug from our end. The fix for this issue will be included in, the weekly patch release, which is expected to be rolled out by the end of September. 
 
Please track the below feedback link to know the status of the issue. 
 
 
We appreciate your patience 
 
Regards, 
 
Sharon Sanchez S. 


Loader.
Up arrow icon