365体育足球滚球比分

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

Testing reducer using Jest receiving state prefixed with “0”: {before the actual state}

So, I was working with Jest to test the reducer and I'm getting the following error Jest error: Expected: [{"assignedfrom": "", "isLoggedIn": false, "username": ""}, {"assignedfrom": "test"}] ...
-1
votes
0answers
23 views

React hooks testing

**I am struggling to write the test case where I can test onChange, updateErrors and setEffect function. CarList is a custom component which has button. when I click on button I need to verify the ...
0
votes
0answers
14 views

Jest, enzyme test throws error on simulate('click') [Cannot read property … of undefined]

So I'm testing this simple function: toggleMenuVisibility = () => { document.getElementsByClassName('menu')[0].classList.toggle('hidden'); } and when I simulate 'click' event I get ...
0
votes
0answers
15 views

Testing and debugging Emotion styled component with jest and enzyme logs '<NO_COMPONENT_SELECTOR>'

I work on a React project which uses @emotion/styled, and I added a sort of an accordion component. Here's a simplified version: <> <TopBarWrapper onClick={toggleAccordion}> <...
0
votes
0answers
27 views

Test event handler with full rendered DOM Leaflet map

I have a component called 'Map' responsible for manage everything I need to render a map using Leaflet plugin (only create the container for the map, request the leaflet map to render and request the ...
1
vote
1answer
25 views

How to test a method which is in mapStateToProps in React using Jest - Enzyme

I'm not able to increase coverage for this line handleSave which I'm passing as a prop to my component. However, I'm importing mapStateToProps from my container file in the test case and used ....
0
votes
0answers
13 views

How to cover test cases for Svg react component using Jest + Enzyme

I am relatively new to react testing. Any help/advice is appreciated. I have this simple PencilIcon component. I saw the test coverage report and the bold text below indicates that those bold text or ...
0
votes
0answers
12 views

Testing form input in jest and enzyme

I've been working with tests in react, and I'm in a trouble with testing form inputs. FormInput component in register <FormInput data-test="form-input" className={`${errors....
0
votes
0answers
19 views

How to simulate onChange on material-ui autoComplete component and check the state value using jest and enzyme

I need to simulate an onChange event with enzyme to update a state's component that is not working, I share the component's code in order to be helped. import React from 'react'; import TextField ...
1
vote
1answer
24 views

Using enzyme, How to find a child component in a component react if they are result of function return

I'm using jest/enzyme and want to check existence child elements of React component if i have function as component child const children = () => ( <> <div>...</div> ...
2
votes
1answer
26 views

How React Testing Library can assert children props and Redux store updates?

I just started exploring a unit testing framework for my react application. I locked my choice at @testing-library/react instead of Enzyme as it is recommended by React and helps writing more robust ...
0
votes
1answer
22 views

How to use test-id in Material UI Textfield

I'm trying to test a material ui text field using react-testing-library. The issue im facing is that in order to test the material ui textField i would have to use this property method screen....
1
vote
1answer
23 views

React jest enzyme function called test

Hi I have a simple component I need to test: MyComponent.js----- import React from 'react'; const MyComponent = (props) => { onClickHandler = () => { console.log('clicked'); props....
0
votes
1answer
24 views

How to test values which depends on localization jest, enzyme?

How to test values that can depend on current localization? function DateNavigation({ locale, date }) { return (locale === 'en') ? <span>{moment(date).format('DD.MM.YYYY')}</span> ...
0
votes
0answers
10 views

How to mock ws client connection using jest/enzyme

I'm trying to unit-test websocket client message handling for a component. This component subscribe to topics with a specific handler for each topic. I'm trying to make sure that when a 'update' came, ...

15 30 50 per page
1
2 3 4 5
201