You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/02/11 17:04:19 UTC

[GitHub] daphne-jr opened a new issue #4403: Test case not passing when callbacks are used in DateFilterControl_spec.jsx + a repeated test case

daphne-jr opened a new issue #4403: Test case not passing when callbacks are used in DateFilterControl_spec.jsx + a repeated test case
URL: https://github.com/apache/incubator-superset/issues/4403
 
 
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if any
   - [x] I have reproduced the issue with at least the latest released version of superset
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar
   
   ### Superset version
   0.23.0rc2
   
   ### Problem
   1. I added callbacks to enable debugging of the tests, but 4 of the test-cases ended up failing. I wonder if anyone would know the reason why or how to fix this?
   2. My colleague noticed that this 2 test-cases are identical / repeated.
   <img width="538" alt="screen shot 2018-02-12 at 12 04 21 am" src="https://user-images.githubusercontent.com/35248123/36075829-fb3a4888-0f4b-11e8-85b2-532067f76bda.png">
   
   ### Expected results
   <img width="243" alt="screen shot 2018-02-12 at 12 49 36 am" src="https://user-images.githubusercontent.com/35248123/36075795-951b8f9e-0f4b-11e8-8123-efa353a5c6f4.png">
   
   ### Actual results
   <img width="378" alt="screen shot 2018-02-12 at 12 46 49 am" src="https://user-images.githubusercontent.com/35248123/36075766-5233a77a-0f4b-11e8-88b3-055049a8b536.png">
   
   
   ### Steps to reproduce
   For 1., added callback to all the test-cases.
   
   Example:
   
   ```
     it('test something', () => {
   
       const label = wrapper.find('.now').first();
   
       label.simulate('click');
   
       setTimeout(() => {
   
         expect(wrapper.state().free).to.equal('now');
   
         expect(wrapper.find('.popover')).to.have.length(0);
   
       }, 10);
   
     });
   ```
   
   to
   
   ```
     it('test something', (done) => {
   
       const label = wrapper.find('.now').first();
   
       label.simulate('click');
   
       setTimeout(() => {
   
         expect(wrapper.state().free).to.equal('now');
   
         expect(wrapper.find('.popover')).to.have.length(0);
   
         done();
   
       }, 10);
   
     });
   ```
   
   ### References
   - https://stackoverflow.com/questions/32730169/how-can-i-use-settimeout-functions-within-mocha-test-cases/32733040#32733040
   
   Thank You!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services