Questions tagged [Modular testing] (237)

0
answer

How to test a shared component Input?

I'm writing a web application Reacte. Made the text input field to a separate component Input. When you need it, prokidyvaya in the props of the state and setter state. Write a unit test for Input. I don't know what to do with setValue, because I have a state outside the component. Help, please. Code in an online sandbox
lilyan60 asked April 16th 20 at 10:11
1
answer

How to write asynchronous jest a test for action // mobx?

Himself action addItem = text => { axios.post("/task", { headers: { "Content-Type": "application/json" }, text: text }) .then(res => { this.arr.push(res.data.task); }) .catch(e => console.log(e)); }; I tried something like this, did not work, I get this error TypeError: Cannot read property 'then' of undefine...
justine asked April 9th 20 at 10:50
1
answer

How to make the IOC function which is imported directly, not as a method of the object (JEST)?

The function that is the method object is replaced by using jest.spyOn. How to make the IOC function, which is imported directly and can be called directly in the test function ?
Lolita.Gerho asked April 9th 20 at 10:10
1
answer

DRF: Why fails the test a PUT method?

Using a Postman's functionality fulfills the instances are updated. Wrote this test class VendorProfileUpdateViewTest(APITestCase): def test_check_partial_update_api(self): data = {"nda": "2020-11-11"} vendor = Vendors.objects.create(vendor_name="U4", country="Belarus" nda="2020-12-12", ) VendorContacts.objects.create...
leatha43 asked April 9th 20 at 09:52
2
answers

How to change state a component of the parent Jest / Enzyme?

I have the main component of Todowhich has a state. In this state I keep todos and name, which is entered through input. I have a separate Input component, to which I just prokidyvaya props: <TodoInput onChange={this.handleInput} /> Tell me what from shallow TodoInput to change state (name) in the parent Todo to tes...
Stan.Aufderhar45 asked April 9th 20 at 09:38
0
answer

Test POST method using unittest Client()?

I can not understand why when you test the POST method returns me a 404 error. There is a class class CsvToDatabase(APIView): permission_classes = (permissions.AllowAny,) serializer_class = VendorsCsvSerializer def post(self, request, format=None): r_data = request.data for data in r_data: the internal logic ..... ...
garrett asked April 8th 20 at 18:01
0
answer

What is the error when configuring vue + mocha?

Problem setting up environment for tests (Vue + Mocha + chai). Code for my tests: in package.json "test": "mocha nyc---webpack webpack-config build/webpack.test.conf.js --require test/setup.js test/**/*.spec.js" "nyc": { "include": [ "src/**/*.(js|vue)" ], "instrument": false, "sourceMap": false } in webpack.test out...
carmine34 asked April 8th 20 at 09:42
0
answer

How to test Redux-form with Jest and enzyme?

Can you tell me links with examples, as well infa could use as mnogobashenniye (HOC) components on the stack React Redux Redux-form Flow test c jest and enzyme ?
Rhiannon asked April 8th 20 at 09:38
0
answer

How to add the PHP module in NetBeans?

Error see screen
Ellen.Pfeffer asked April 8th 20 at 02:57
3
answers

A novice tester, where to start, where to practice?

Good afternoon. You need the maximum amount of information and preferably detailed. There is a desire to go into testing. The superficial knowledge, was the preparation in one office, but in the end did not take very negligent attitude, although the topic was interesting. As everything was pretty uscontrolled, I would lik...
Elliot asked April 8th 20 at 02:51