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

Frontend tests #3990

Open
SychO9 opened this issue May 17, 2024 · 0 comments · May be fixed by #3991
Open

Frontend tests #3990

SychO9 opened this issue May 17, 2024 · 0 comments · May be fixed by #3991
Assignees
Milestone

Comments

@SychO9
Copy link
Member

SychO9 commented May 17, 2024

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

  • Avatar
  • Badge
  • Button
  • Checkbox
  • ColorPreviewInput
  • Dropdown
  • FieldSet
  • Modal & FormModal
  • Input
  • Icon
  • Link & LinkButton
  • LoadingIndicator
  • MultiSelect
  • Select
  • SelectDropdown
  • SplitDropdown
  • Tooltip (tied to jquery so skipping for now)

Utils/Helpers

  • highlight
  • string
  • extractText
  • listItems
  • extend & override

Extenders

  • Model
  • PostTypes
  • Notification
  • Routes
  • Search
  • Store

Larger components

  • PostStream
  • AlertManager
  • ModalManager
  • The various modals (asserting that they render without issue would already be good to have)
  • Somepages like the IndexPage if possible

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


Must also add the Jest infra generation to the CLI.

@SychO9 SychO9 added this to the 2.0 milestone May 17, 2024
@SychO9 SychO9 self-assigned this May 17, 2024
@SychO9 SychO9 linked a pull request May 18, 2024 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant