aiidalab / aiidalab-widgets-base

Reusable widgets for AiiDAlab applications
MIT License
7 stars 17 forks source link

Implement basic tests #347

Closed csadorf closed 1 year ago

csadorf commented 2 years ago
csadorf commented 2 years ago

For this repository we should focus on unit testing individual widgets by manipulating their traits and checking the expected widget state. This will ensure API consistency and widget behavioral correctness.

Testing the interface via selenium or similar should only be necessary in specific cases.

csadorf commented 2 years ago

For this library, we should also measure the coverage, similar to aiidalab-launch and eventually aim for a test coverage of at least 75-80%. I would consider this issue completed if we reach a coverage of 15%.

unkcpz commented 1 year ago

As a part of https://github.com/aiidalab/aiidalab-widgets-base/pull/344, I implement the tests by replacing aiidalab-test-app-action with pytest-selenium + pytest-docker. Seems all work well.

yakutovicha commented 1 year ago

since #344 is merged, should we close this @unkcpz?

unkcpz commented 1 year ago

since https://github.com/aiidalab/aiidalab-widgets-base/pull/344 is merged, should we close this @unkcpz?

Sure! I'd say so.

danielhollas commented 1 year ago

I'd say there are some remaining tasks here based on discussions above

Perhaps these should go to separate issues?

unkcpz commented 1 year ago

@danielhollas thanks for pointing this out. I think you are right, no need for another issue, I'll reopen this one and change the title and use the checkboxes from your comment if you don't mind.

danielhollas commented 1 year ago

Blocked on #318

unkcpz commented 1 year ago

@yakutovicha From the checkboxes above, what we missing is the docs. I personally don't think it is useful to document how to write a unit test, it is all in the codes.

unkcpz commented 1 year ago

I would consider this as completed.