junkboy0315/react-compare-image

Two tests fail

Closed this issue · 2 comments

$ npm test
> react-compare-image@1.3.0 test /Users/ZZZ/git/react-compare-image
> jest

 FAIL  src/ReactCompareImage.test.jsx
  ● ReactCompareImage › show skeleton if it is provided as props

    expect(received).toBeFalsy()

    Received: <div data-testid="skelton" />

      49 |
      50 |     // // hide skeleton if the images are fully loaded
    > 51 |     expect(queryByTestId('skelton')).toBeFalsy();
         |                                      ^
      52 |
      53 |     // show skeleton again if the image url is changed
      54 |     rerender(

      at toBeFalsy (src/ReactCompareImage.test.jsx:51:38)
      at tryCatch (node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:65:40)
      at Generator.invoke [as _invoke] (node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:303:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:117:21)
      at asyncGeneratorStep (src/ReactCompareImage.test.jsx:11:103)
      at _next (src/ReactCompareImage.test.jsx:13:194)
      at src/ReactCompareImage.test.jsx:13:364
      at Object.<anonymous> (src/ReactCompareImage.test.jsx:13:97)

  ● ReactCompareImage › container is invisible until images is fully loaded

    expect(element).toBeVisible()

    Received element is not visible:
      <div data-testid="container" style="box-sizing: border-box; position: relative; width: 100%; overflow: hidden; display: none;" />

      79 |     fireEvent.load(rightImage);
      80 |
    > 81 |     expect(container).toBeVisible();
         |                       ^
      82 |   });
      83 |
      84 |   test('show custom handle', () => {

      at Object.toBeVisible (src/ReactCompareImage.test.jsx:81:23)

Test Suites: 1 failed, 1 total
Tests:       2 failed, 3 passed, 5 total
Snapshots:   0 total
Time:        1.694s, estimated 3s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

not reproducable on my enviroment.

@shazron
ok, I understand. The cause is that you use npm.
This project uses yarn to lock npm packages.
Anyway, If you upgrade to v1.4.0(published today) solve probrem.