Add frontend tests to docs

This commit is contained in:
Michael Shamoon 2022-03-30 09:54:43 -07:00
parent be2b59431f
commit 70bc70ec97

View File

@ -34,6 +34,8 @@ it fixed for everyone!
Before contributing please review our `code of conduct`_ and other important Before contributing please review our `code of conduct`_ and other important
information in the `contributing guidelines`_. information in the `contributing guidelines`_.
.. _code-formatting-with-pre-commit-hooks:
Code formatting with pre-commit Hooks Code formatting with pre-commit Hooks
===================================== =====================================
@ -183,6 +185,31 @@ X-Frame-Options are in place so that the front end behaves exactly as in product
relies on you being logged into the back end. Without a valid session, The front end will simply relies on you being logged into the back end. Without a valid session, The front end will simply
not work. not work.
Testing and code style:
* The frontend code (.ts, .html, .scss) use ``prettier`` for code formatting via the Git
``pre-commit`` hooks which run automatically on commit. See
:ref:`above <code-formatting-with-pre-commit-hooks>` for installation. You can also run this
via cli with a command such as
.. code:: shell-session
$ git ls-files -- '*.ts' | xargs pre-commit run prettier --files
* Frontend testing uses jest and cypress. There is currently a need for significantly more
frontend tests. Unit tests and e2e tests, respectively, can be run non-interactively with:
.. code:: shell-session
$ ng test
$ npm run e2e:ci
Cypress also includes a UI which can be run from within the ``src-ui`` directory with
.. code:: shell-session
$ ./node_modules/.bin/cypress open
In order to build the front end and serve it as part of django, execute In order to build the front end and serve it as part of django, execute
.. code:: shell-session .. code:: shell-session