Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test harness for frontend components #197

Open
jdmedlock opened this issue Feb 3, 2019 · 1 comment
Open

Add test harness for frontend components #197

jdmedlock opened this issue Feb 3, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jdmedlock
Copy link
Collaborator

Add a test harness utilizing the Jest and Enzyme packages for use by frontend components.

@jdmedlock jdmedlock self-assigned this Feb 3, 2019
@jdmedlock jdmedlock added the enhancement New feature or request label Feb 3, 2019
jdmedlock added a commit that referenced this issue Feb 4, 2019
Setup configuration for Jest/Enzyme testing
- Add `tests` directory
- Add `testSetup.js` Adaptor and `Footer-test.js` to validate test harness setup

Resolves: N/a
See also: #197
jdmedlock added a commit that referenced this issue Feb 4, 2019
Modify display of shallow copy of <Footer> and example `expect` to work correctly
- This is a prerequisite before we start adding real tests

Resolves: N/a
See also: #197
@jdmedlock
Copy link
Collaborator Author

jdmedlock commented Feb 4, 2019

What follows is commentary and a proposal for how we should approach testing in the FE. I firmly believe we should spend a few minutes on this as a team to agree on a direction. Not because we need "group think", but because testing touches us all and is important both as a way to develop faster and to generate a higher quality product.

Before continuing, take the time to listen to Javascript Jabber #341. It's FE/BE agnostic and contains a huge amount of practical advice on how to approach testing. Seriously. I mean it. Vamp I'm talking to you.

To keep this short the guidelines for our approach should be:

  1. You don't have to develop tests before coding a component, but tests are required before PR's can be approved for merge.
  2. Implement the "diamond" approach to testing - concentrate the majority of effort on integration tests and impement unit and end-to-end (E2E) tests only as necessary. Unit tests are fragile since they are so closely tied to the UI. E2E tests are difficult and time consuming to build, so concentrate on "happy path" E2E tests to be used for high level validation before and after moving new functionality into production
  3. For now use manual testing to validate screen appearance. There are tools like Applitools, but IMHO validation of visual elements isn't taking much time at this point so automated appearance testing can be deferred.

Additional references:

Fini.

jdmedlock added a commit that referenced this issue Feb 4, 2019
Add prototype code for Footer component tests (IN-PROGRESS)
- This is a work in-progress. Unfinished

Resolves: N/a
See also: #197
jdmedlock added a commit that referenced this issue Feb 5, 2019
Add Footer component unit tests
- These are included as examples of how to traverse the DOM in the validation process

Resolves: N/a
See also: #197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant