cds-snc / cds-snc/platform-forms-client

Improve automated testing of the application

Open
#7,455 0 comments 0 reactions 1 assignee Claimed by @ShadeWyrm View on GitHub
app tech debt testing
Dominant language
TypeScript
Stars
46
Forks
16
Avg merge
1d 9h
Merged PRs (30d)
91

Description

## Context

We currently have some testing in place, split across multiple tools (Jest, Vitest, Cypress, Playwright), however, our tests are not fully end-to-end and can be fragmented, incompatible or out-of-date, meaning we lack coverage:

- Jest doesn’t account for component tests or Vitest
- Cypress component testing is not compatible with our App Router (Next.js update)
- Some tests and utility functions were flagged “TODO” and haven’t been revisited
- Cypress is also behind a version and needs to be updated to unlock new testing reports
- There's reusable test code that can be leveraged once compatibility is resolved

## Description

Work on defining a test writing framework
Dynamic testing on form components

- Decide whether to use JavaScript/TypeScript or Python
- Black box / functional testing
- Use of AI
- Building out a plan
- Figure out how to get frameworks running on Mac

## Problems to solve

- How do we test an end-to-end component without "faking it"?
- How do we ensure the data output (HTML, CSV, etc.) doesn't break?
- How do we test for multiple data delivery paths? (Email, Vault, API, Pilot)
- How do we test edge cases that we cannot anticipate?
- What kinds of errors do we not care about?
- How do we deal with false positives and not get too comfortable?
- How do we test backwards compatibility with NextJS's Server ID shifts?

## Acceptance criteria

- [ ] Checks for every form _component_ in every _state_
- [ ] Checks for every _delivery method_ to ensure they work
- [ ] Checks single and multi-page forms, within repeating sets, with branching applied
- [ ] ...

## Links

https://miro.com/app/board/uXjVLmd8L0U=/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.