nikgraf / belle

Configurable React Components with great UX
http://nikgraf.github.io/belle/
MIT License
2.51k stars 104 forks source link

Select.js tests fail #332

Closed cezarneaga closed 7 years ago

cezarneaga commented 7 years ago

Was just curios if everyone is getting the same results. I am curios because the commit shows as tests passing


FAIL  src/__tests__/Select-test.js
  ● Select › should be able to provide a valueLink

    expect(received).toBeTruthy()

    Expected value to be truthy, instead received
      false

      at Object.<anonymous> (src/__tests__/Select-test.js:192:23)

  ● Select › should be able to provide a onUpdate callback

    expect(received).toBeTruthy()

    Expected value to be truthy, instead received
      false

      at Object.<anonymous> (src/__tests__/Select-test.js:208:23)

  ● Select › should change the selectedValue & focusedOptionValue on selection

    expect(received).toBe(expected)

    Expected value to be (using ===):
      "vienna"
    Received:
      "rome"

      at Object.<anonymous> (src/__tests__/Select-test.js:222:40)```
nikgraf commented 7 years ago

Tests work fine for me:

➜  belle git:(master) npm run test

> belle@3.0.0 test /Users/nikgraf/Projects/belle/belle
> BABEL_ENV=test BABEL_JEST_STAGE=0 jest src/

 PASS  src/__tests__/union-class-names-test.js
 PASS  src/__tests__/Separator-test.js
 PASS  src/__tests__/Select-test.js
 PASS  src/__tests__/Rating-test.js
 PASS  src/__tests__/Placeholder-test.js
 PASS  src/__tests__/Spinner-test.js
 PASS  src/__tests__/helpers-test.js
 PASS  src/__tests__/DatePicker-test.js
 PASS  src/__tests__/date-helpers-test.js
 PASS  src/__tests__/ComboBox-test.js
 PASS  src/__tests__/Card-test.js
 PASS  src/__tests__/TextInput-test.js
 PASS  src/__tests__/Button-test.js
 PASS  src/__tests__/Option-test.js
Test Summary
 › Ran all tests matching "src/".
 › 192 tests passed (192 total in 14 test suites, run time 13.947s)
cezarneaga commented 7 years ago

yeap! you are right! if in SelectItem.js i change to onMouseDown i get:

 ● Select › should be able to provide a valueLink

    expect(received).toBeTruthy()

    Expected value to be truthy, instead received
      false

      at Object.<anonymous> (src/__tests__/Select-test.js:192:23)

  ● Select › should be able to provide a onUpdate callback

    expect(received).toBeTruthy()

    Expected value to be truthy, instead received
      false

      at Object.<anonymous> (src/__tests__/Select-test.js:208:23)

  ● Select › should change the selectedValue & focusedOptionValue on selection

    expect(received).toBe(expected)

    Expected value to be (using ===):
      "vienna"
    Received:
      "rome"

      at Object.<anonymous> (src/__tests__/Select-test.js:222:40)

need to see why. will get back if i find the cause.

C