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

Fix test suite to properly handle async specs #109

Merged
merged 6 commits into from
Dec 19, 2024
Merged

Conversation

nikku
Copy link
Member

@nikku nikku commented Nov 20, 2024

As a matter of fact the test suite to date does not correctly handle async specs like this, a prominent (and used) pattern:

describe('some spec', function() {

  it('test asynch', inject(async function(...) {
    throw new Error('HAHA, this will not be reported as a test failure');
  }));
  
});

I fixed this via c9ee643.

Of course this covers up a bunch (24 / 130) broken tests. One test (verifying version tag tooltip) was completely broken, used a non-existing utility, and was structured so it would never work. The test is now properly architected, and works, modeling a user flow:

capture GKfmi2_optimized

I did not touch the other 24 failing tests, but I suggest we handle them ("make them work") in similar ways.

This test was previously failing, but async, outside
of the test cycle.

It was also broken, because it did not toggle open the
general tab; so hovering over the actual `versionTag`
field could never happen. Now we clearly model the user
journey.

Bonus points for getting rid of `clock`. We can simply
use `waitFor` to wait for a DOM element expected for
arrival.
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Nov 20, 2024
@nikku nikku requested review from a team, jarekdanielak and barmac and removed request for a team November 20, 2024 17:30
@nikku nikku added the ready Ready to be worked on label Nov 21, 2024 — with bpmn-io-tasks
@nikku nikku removed the needs review Review pending label Nov 21, 2024
@nikku nikku marked this pull request as draft November 21, 2024 14:35
@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed ready Ready to be worked on labels Nov 21, 2024
@nikku
Copy link
Member Author

nikku commented Nov 21, 2024

Converted to draft as this needs further "action".

@nikku nikku removed their assignment Nov 21, 2024
@nikku nikku added ready Ready to be worked on and removed in progress Currently worked on labels Nov 21, 2024
@barmac barmac removed the request for review from jarekdanielak December 3, 2024 14:07
@jarekdanielak
Copy link
Contributor

jarekdanielak commented Dec 18, 2024

All tests are now green. ✅

We (me) changed some fields in the properties panel from inputs to text areas and forgot to adjust in the tests. I also added some values to the fields in fixture not to compare against undefined -> 5873297

Rest of the changes are about some incorrect element ID or wrong bootstrapping of the modeler.

@jarekdanielak jarekdanielak marked this pull request as ready for review December 18, 2024 13:06
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed ready Ready to be worked on labels Dec 18, 2024
@@ -116,10 +116,10 @@ describe('provider/dmn - IdProps', function() {
it('should set invalid', inject(async function(elementRegistry, selection) {

// given
const task = elementRegistry.get('Task_1');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤡

@barmac
Copy link
Member

barmac commented Dec 18, 2024

I've pushed 93a903a to not print the XML on CI/when all tests are run, but overall the PR looks good. Great job!

@nikku
Copy link
Member Author

nikku commented Dec 19, 2024

Thanks @jarekdanielak for taking this on 💪

@nikku nikku merged commit 937e278 into main Dec 19, 2024
8 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Dec 19, 2024
@nikku nikku deleted the test-correct-inject branch December 19, 2024 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants