Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.

Conventions

Nicholas Romero edited this page Jun 26, 2017 · 5 revisions

Initial Data

When working on the client side, it's a good idea to mock the Relay data structures which are just an additional spec on top of GraphQL

Factories should be used to generate seed data on the server which can than be hooked into django management commands and tests later on this keeps things dry and avoids source control data becoming out of data when using the django dumpdata and loaddata commands.

Testing

Djangos built in test utils are used extensively to unit test the graphql endpoint. We mock a logged in users jwt token and perform the various mutations and queries needed.

Browser/Selenium testing is also provided by the built in django commands. See testing page for more

Styled form components

Should be stateless and work off state of parent components input object stored in the parent objects state

When developing new components just mock data in the component

Url parameter driven data

The idea here being that urls can be sharable and bookmarked. Although we must make considerations on how to handle react native.

Components should initially be set to have loading state. Once the component mounts it should then perform relay related data fetching based on url parameters.

Explicit javascript module

When you can make your imports explicit that way webpack can pull in only the things it needs rather than the entire module.

Lists, filters etc

Active tab and steppers