Data dodania Pytanie
2017-11-07 13:11 ReactJS/Enzyme: How to test a submit function, which calls a graphQL mutation via prop »
I'm trying to write a unit test (enzyme/jest) for this function: _onSubmit = (event) => { event.preventDefault() const { username, password } ...
(1) odpowiedzi
2017-10-04 14:10 Error: Enzyme Internal Error: unknown composite type undefined »
I'm getting this error when try to apply enzyme and I couldn't find any relative issue about this. Here's the test.js; import React from 'react'; im...
(1) odpowiedzi
2017-07-03 17:07 Basic react rendering test: exists() vs. length »
In your basic rendering tests of a React component, which approach is more solid? const wrapper = shallow(<MyComponent />); expect(wrapper.ex...
(2) odpowiedzi
2017-06-24 15:06 How to test React component return by other React component's method »
Here is the sample code, In the following code <MyComponent /> has method called getHeader. I am trying to test getHeader method. const Header ...
(1) odpowiedzi
2017-05-26 12:05 Enzyme check if component mounted without errors on prop types »
I am creating integration test for a components to test its interface and I am mounting it like so const wrapper = shallow(<Component boolVal={()=...
(1) odpowiedzi
2017-05-20 08:05 Enzyme: When to use shallow, render, or mount? »
From the Enzyme docs shallow, render, and mount are described, but when to use which method? ...
(1) odpowiedzi
2017-05-13 03:05 Unmount and then wrapper.mount() again does not work properly at Enzyme »
Enzyme: 2.8.2 React: 15.5.4 If we do wrapper.unmount(), and then wrapper.mount(), the component is not mounted properly. I can see an empty console o...
(0) odpowiedzi
2017-04-13 20:04 travis cannot build because Error: Cannot find module 'react-test-renderer/shallow' »
The npm run test works fine locally. However , travis insists that the build is failed and it shows the following log : react-test-renderer is an ...
(2) odpowiedzi
2017-04-02 06:04 Wait on all promises in a simulate call »
I am using Jest and Enzyme to test React components. My React component (under test) has a remote select component. When the user types some text, da...
(1) odpowiedzi
2017-01-05 12:01 How to test inner functions defined on Stateless Components in React with Enzyme »
I'm using enzyme to test my react components. I have a stateless component that has an inner function. How can i call and test that inner function? H...
(1) odpowiedzi
2016-12-11 18:12 What is the difference between jest.mock(module) and jest.fn() »
I have tried couple different ways of defining the mock function and all of my tries failed. When I try to define it as follow: jest.mock('../src/dat...
(1) odpowiedzi
2016-11-07 14:11 Setting up Jest and Enzyme to test React 15 cannot find module react/lib/ReactTestUtils »
I have a react project and am trying to setup some tests Due to the following setup guides / issues: https://github.com/facebook/jest/issues/1353 ,...
(1) odpowiedzi
2016-10-24 00:10 Mocking Reflux.js store during React component shallow rendering in test with enzyme »
I'm writing React application. I want to test in isolation component that is wired up with Reflux.js store with: mixins: [ Reflux.connect(Count...
(0) odpowiedzi
2016-09-30 22:09 Why does React add '.$' to the start of a key »
I have react component that renders something like: <div> <div key='bowie'>something</div> <div> when I query the keys ...
(1) odpowiedzi
2016-09-26 14:09 Files upload testing in Enzyme »
I have a FileInput in my render function <FileInput accept= "image/jpeg,image/png,audio/mp3" onChange= {this.fileInputOnChange} ...
(1) odpowiedzi
2016-09-14 15:09 Enzyme, how to find a child of wrapper by attribute? »
I have the following React component in a Redux application. <Modal> <Modal.Header closeButton onClick={props.onHide}> <Modal.Titl...
(2) odpowiedzi
2016-08-04 09:08 How to set object type props value in an enzyme for a react component? »
I tried two ways, 1. const wrapper=shallow(<ActiveConversation />) wrapper.setProps({activeConversation:c,agent:a}); expect(wrapper.prop('mess...
(1) odpowiedzi
2016-05-04 09:05 Injecting react-intl object into mounted Enzyme components for testing »
EDIT: Solved! Scroll down for the answer In our Component tests we need them to have access to the react-intl context. The problem is that we are m...
(1) odpowiedzi