flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.29k stars 832 forks source link

Frontend tests #3990

Closed SychO9 closed 6 days ago

SychO9 commented 4 months ago

While tests are very helpful, too many tests, or too intensive tests make the code hard and more cumbersome to change. So what we need are rather basic tests for components, and when appropriate (like extenders or utils/helpers) more in-depth tests.

Striking a balance between sufficient test coverage and maintainability is crucial here.

The most basic test we can have for a component, yet can still be useful, is that it simply renders without issues and some interactions (such as any clicks) work as expected.

We'll prioritize components that are building blocks of other components. Then Utils/Helpers that are most commonly used. Then Extenders. And finally Large components. (integration tests if possible)

Building Blocks

Utils/Helpers

Extenders

Larger components


Relevant links, should be documented with the docs we will add for frontend testing:


Must also add the Jest infra generation to the CLI.