taiga-family / taiga-ui

Angular UI Kit and components library for awesome people
https://taiga-ui.dev
Apache License 2.0
3.28k stars 463 forks source link

🛠 - Cover components with harnesses #476

Open waterplea opened 3 years ago

waterplea commented 3 years ago

🚀 Feature request

To make it easy to test Taiga UI components and apps that use them we should provide component harnesses for all our components.

waterplea commented 3 years ago

This issue is rather big and it's fine to make many smaller PRs covering single component.

alvaromartmart commented 2 years ago

I'm interested in gaining some experience with developing component harnesses so I'd be happy to contribute to this. However, I'm not sure whether @zarghamkhandev is working on every one of them or tracking progress somehow. Please let me know if I can take one of the components 👀

waterplea commented 2 years ago

I'm interested in gaining some experience with developing component harnesses so I'd be happy to contribute to this. However, I'm not sure whether @zarghamkhandev is working on every one of them or tracking progress somehow. Please let me know if I can take one of the components 👀

I believe he's not working on any more harnesses at the moment so just pick a component you'd like to try and let us know here in a comment so nobody else takes it.

zarghamkhandev commented 2 years ago

@alvaromartmart feel free to take any component, I will take input components next. 🚀

alvaromartmart commented 2 years ago

I'll start with the action component since it looks like a simple one, plus it doesn't have unit tests so I'll add them using the harness

alvaromartmart commented 2 years ago

FYI I'll create a harness for the filter component

zarghamkhandev commented 2 years ago

Instead of input, I will take toggle component next.

zarghamkhandev commented 2 years ago

I'll write harness for accordion component next.

splincode commented 1 month ago

@waterplea is it actual now? I suspect more efficient testing now is to use playwright or cypress

alvaromartmart commented 1 month ago

@waterplea is it actual now? I suspect more efficient testing now is to use playwright or cypress

my 2cents: they serve different purposes - component harnesses are useful for developers consuming Taiga UI in their unit/integration tests. Plus playwright doesn't (yet) support angular component testing.

waterplea commented 1 month ago

@alvaromartmart is right, these are basically public testing APIs for our components for other people to use

splincode commented 1 month ago

@alvaromartmart maybe, but lately I don't write unit tests anymore, as all issues are closed by playwright e2e and cypress component testing

alvaromartmart commented 1 month ago

@alvaromartmart maybe, but lately I don't write unit tests anymore, as all issues are closed by playwright e2e and cypress component testing

I understand that, by are you speaking as a taiga-ui maintainer or as an end user? As an end user of this UI library (or any other) I personally find it very convenient that the library provides component testing harnesses so my tests can be more robust to internal implementation changes of that libraries (since the harnesses should in theory provide me an up to date API to interact with them).

splincode commented 1 month ago

Sure, but I see that there is practically no one to support @taiga-ui/testing package and add new harnesses to it

waterplea commented 1 month ago

Let's keep it open for now and investigate internal need for it by v5. Components got much simpler internally, maybe it would be much easier to write harnesses for them.