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

[INFRA] Rework the integration tests about CSS and style API interactions #2743

Closed
tbouffard opened this issue Jun 13, 2023 · 0 comments · Fixed by #2825
Closed

[INFRA] Rework the integration tests about CSS and style API interactions #2743

tbouffard opened this issue Jun 13, 2023 · 0 comments · Fixed by #2825
Assignees
Labels
chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)
Milestone

Comments

@tbouffard
Copy link
Member

tbouffard commented Jun 13, 2023

https://github.com/process-analytics/bpmn-visualization-js/pull/2732/files#r1225424168

We could/should create a dedicated file to store the tests about the interactions between the 2 APIs.
The checks about the CSS are currently done only by checking the DOM. As we override the mxGraph code to make mxGraph add the CSS classes, so we must keep DOM tests.

But we are updating the CSS classes directly in the mxGraph model, so we could add new tests to directly check the mxGraph model.

Note that this should be done before implementing #2803 if we're adding more tests to make sure we've looked at all the cases involved in the refactoring.

@tbouffard tbouffard added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label Jun 13, 2023
@tbouffard tbouffard added this to the 0.37.0 milestone Jun 13, 2023
@tbouffard tbouffard modified the milestones: 0.37.0, 0.38.0 Jun 26, 2023
@csouchet csouchet modified the milestones: 0.38.0, 0.38.1 Jul 24, 2023
@csouchet csouchet modified the milestones: 0.38.1, 0.38.2 Aug 22, 2023
@tbouffard tbouffard moved this to In Progress in Roadmap 2023 Aug 27, 2023
@tbouffard tbouffard self-assigned this Aug 27, 2023
tbouffard added a commit that referenced this issue Aug 28, 2023
Previously, when applying the "CSS" API, the implementation ensured that
the cell's original style was cached (for any subsequent reset) without
any additional CSS classes. In fact, this was not necessary. Storing
styles in the cache with additional CSS classes information posed no
problem. When the style is reset, the value retrieved from the cache is
updated with the CSS classes currently applied to the cell. This works
just as well if there are no CSS classes as if there are. This
additional check has therefore been removed.

The tests verifying interactions between the "CSS" and "Style" APIs have
been improved. They confirm that the removal of this coupling is
legitimate:
  - Introduce a dedicated test file for these tests.
- Previously, they were stored in the file testing the style update at
template level.
- This change provides an explicit way of identifying API interaction
tests and a better separation of concerns.
- Add a dedicated test to check the impact of resetting the style after
a CSS and style update. This proves the uselessness of the coupling
described above.

covers #2803
closes #2743

---------

Co-authored-by: Souchet Céline <[email protected]>
@github-project-automation github-project-automation bot moved this from In Progress to Done in Roadmap 2023 Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)
Projects
No open projects
Archived in project
2 participants