Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page contains a list of common questions that new contributors might have when getting started, and hopefully provides useful answers.
This list is a work in progress, please feel free to add anything that new contributors might find useful.

Table of Contents

Do I need to configure a local database for testing?

No, while the test command points to a local database, vly-test, this is actually an in-memory database that is created during execution of the test script for the purpose
of running the tests. You don't need to do anything but run the test script by typing "npm run test".


My module page works except when I force a reload.

App uses server side rendering, so when a forced reload is requested the page is fully rendered server side. Normally only the first page is rendered and others are loaded dynamically.

...

Code Block
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
    in PersonUpdatePage
    in Connect(PersonUpdatePage)
    in withRouter(Connect(PersonUpdatePage))
   


I'm on a Mac, and running 'mongod' seems to be erroring out?

The solution may be found here; the problem may be that you aren't pointing to an existing /data/db folder.

To do this, run the command as follows: 'mongod --dbpath <absolute path to /data/db folder within vly1 repo>' (E.g for me it was 'mongod --dbpath ~/Documents/workspace/vly1/data/db/').

What is this Redux debug sidebar ?

This is included in client/store.js. and comes from client/modules/App/components/DevTools.js

There are mutiple tools in the dock

LogMonitor
The default monitor for Redux DevTools with a tree view.
It shows a log of states and actions, and lets you change their history.
This is wrapped in DockMonitor to create the sidebar.
toggleVisibilityKey="ctrl-h"
changePositionKey="ctrl-w"
defaultSize="0.2"

Getting "E11000 duplicate key" errors with MongoDB

This error can occur when you try and insert a record when an index field is "left over" that shouldn't be there. These can remain even if you update the Schema. You'll need to manually clear the offending index in your database (or just drop the database (smile) ). See this page for further details: https://stackoverflow.com/questions/23695676/mongoosejs-cant-disable-unique-to-field



AVA **/file no longer works

Ava - the test runner we use in npm test used to take glob wild cards like **/OpDetails.spec.js  which would find the file in any folder.   In the upgrade to v4 this was removed.  Instead you have to specify a complete path to the target file.

...

Code Block
npm test `**/OpDetail*.spec`

> @voluntarily/vly2@1.0.0 test /Users/watkinsav/workspace/voluntarily/vly2
> cross-env NODE_ENV=test PORT=8080 node_modules/.bin/nyc node --no-deprecation node_modules/ava/cli.js "components/Op/__tests__/OpDetail.spec.js" "components/Op/__tests__/OpDetailForm.spec.js" "components/Op/__tests__/OpDetailTagsEditable.spec.js"



Test cases using mongodb memory database timed-out without completing in Ubuntu 18.04 LTS


After a package update in 18.04. some ava tests were timed out and displyed a messafge like below.

...

Follow the instructions here to install MongoDB Community edition in Ubuntu.

Simulate onChange is not working when the component is rendered using Mount 

The change event is not working with the antd Select component for some reason when the component is rendered using mount.

...

Code Block
languagejs
const handleSort = sinon.fake((sortOrder) => t.is(sortOrder, 'name'))
  const wrapper = shallowWithIntl(
    <OpOrderBy onChange={handleSort} />
  )
  wrapper.find('Select').first().simulate('change', 'name')

Getting "' 'rm' is not recognized as an internal or external command" error when running npm test in Windows

The issue occurs when Windows doesn't recognize Linux commands in the command prompt.

The fix is to add the git bin folder location in the system environment variables→ environment variables→ path variable for the windows user. For details check the last answer https://stackoverflow.com/questions/49032646/ls-is-not-recognized-as-an-internal-or-external-command-operable-program-or-b