TypeError: (0, _ css .default) не является функцией - PullRequest
0 голосов
/ 08 мая 2020

Я получаю эту ошибку, когда запускаю модульные тесты с jest в моем приложении реакции. Ниже приведена полная трассировка стека ошибки. Ошибка возникает, когда я обновил версию react- bootstrap до 1.0.1 из бета-версии. Любая помощь приветствуется. Спасибо!

test/components/Guest/ContactInformation/ContactItemEditDelete.test.js
  ● components/AddGuest/ContactItemEditDelete › should trigger delete

    TypeError: (0 , _css.default) is not a function

      56 | 
      57 |              expect(deleteButton.exists()).toBeTruthy();
    > 58 |              deleteButton.simulate("click");
         |                           ^
      59 | 
      60 |              const modal = container.find(".modal");
      61 | 

      at BootstrapModalManager.setContainerStyle (node_modules/react-overlays/cjs/ModalManager.js:87:57)
      at BootstrapModalManager.setContainerStyle (node_modules/react-bootstrap/cjs/BootstrapModalManager.js:63:47)
      at BootstrapModalManager.add (node_modules/react-overlays/cjs/ModalManager.js:128:12)
      at Object.add (node_modules/react-overlays/cjs/Modal.js:58:27)
      at Object.current (node_modules/react-overlays/cjs/Modal.js:141:11)
      at node_modules/@restart/hooks/cjs/useEventCallback.js:15:39
      at node_modules/react-overlays/cjs/Modal.js:182:5
      at commitHookEffectList (node_modules/react-dom/cjs/react-dom.development.js:17283:26)
      at commitPassiveHookEffects (node_modules/react-dom/cjs/react-dom.development.js:17307:3)
      at HTMLUnknownElement.callCallback (node_modules/react-dom/cjs/react-dom.development.js:149:14)
      at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:193:27)
      at HTMLUnknownElementImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:119:9)
      at HTMLUnknownElementImpl.dispatchEvent (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:82:17)
      at HTMLUnknownElementImpl.dispatchEvent (node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js:30:27)
      at HTMLUnknownElement.dispatchEvent (node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:157:21)
      at Object.invokeGuardedCallbackDev (node_modules/react-dom/cjs/react-dom.development.js:199:16)
      at invokeGuardedCallback (node_modules/react-dom/cjs/react-dom.development.js:256:31)
      at commitPassiveEffects (node_modules/react-dom/cjs/react-dom.development.js:18774:9)
      at wrapped (node_modules/react-dom/node_modules/scheduler/cjs/scheduler-tracing.development.js:207:34)
      at flushPassiveEffects (node_modules/react-dom/cjs/react-dom.development.js:18822:5)
      at renderRoot (node_modules/react-dom/cjs/react-dom.development.js:19365:3)
      at performWorkOnRoot (node_modules/react-dom/cjs/react-dom.development.js:20342:7)
      at performWork (node_modules/react-dom/cjs/react-dom.development.js:20254:7)
      at performSyncWork (node_modules/react-dom/cjs/react-dom.development.js:20228:3)
      at Object.batchedUpdates$1 [as unstable_batchedUpdates] (node_modules/react-dom/cjs/react-dom.development.js:20443:7)
      at Object.act (node_modules/react-dom/cjs/react-dom-test-utils.development.js:1161:27)
      at wrapAct (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:346:13)
      at Object.simulateEvent (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:481:9)
      at ReactWrapper.call (node_modules/enzyme/src/ReactWrapper.js:666:22)
      at ReactWrapper.single (node_modules/enzyme/src/ReactWrapper.js:1168:21)
      at ReactWrapper.simulate (node_modules/enzyme/src/ReactWrapper.js:665:17)
      at Object.<anonymous> (test/components/Guest/ContactInformation/ContactItemEditDelete.test.js:58:16)
...