newfold-labs / wp-module-ecommerce

Next-generation eCommerce Experience for WordPress sites at Newfold Digital.
GNU General Public License v2.0
7 stars 3 forks source link

Update/tests #324

Closed circlecube closed 2 months ago

circlecube commented 2 months ago

Proposed changes

This updates the tests that have been failing. It should speed them up as well.

I've implemented the testIsolation flag so each test is expected to be more independent, and combined tests that were not independent to run in the same it. (We are working through all tests to use this recommended setting so I went ahead and added while I was working on these.)

I combined some cli commands too so they should run faster. These were eating up a lot of time running on and before each test step and many were repeated so I was able to combine test steps and cli commands.

I also started adding some data testid attributes to elements which can be used once they are included in the build, I didn't switch to those yet though they are commented out for selecting the nowoo-store-title and description, they should be a faster and clearer way to select elements on the page.

This also includes some lint fixes my IDE changed, I hope it doesn't make review confusing.

Type of Change

Checklist

Further comments

circlecube commented 2 months ago

These are now finally passing tests. I converted all but one of the tests to use testIsolation - and the remaining one (ecommerce-next-steps) I didn't update it because it does not pass locally for me, I assume I need to start with a fresh install so the next steps display properly.

Friendly reminder that new features should have new tests and PRs shouldn't be merged unless tests pass. We certainly should not release a module with failing tests because that cascades to every other module and plugin displaying failing tests.