Skip to content

fix(test): deflake diagram-editor tests COMPASS-9462 #7030

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

Merged
merged 5 commits into from
Jun 17, 2025

Conversation

mabaasit
Copy link
Contributor

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@mabaasit mabaasit requested a review from a team as a code owner June 17, 2025 08:42
@github-actions github-actions bot added the fix label Jun 17, 2025
const diagram = useDiagram();

const setDiagramContainerRef = useCallback(
(ref: HTMLDivElement) => {
Copy link
Collaborator

@gribnoysup gribnoysup Jun 17, 2025

Choose a reason for hiding this comment

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

Suggested change
(ref: HTMLDivElement) => {
(ref: HTMLDivElement | null) => {

@mabaasit mabaasit added the no release notes Fix or feature not for release notes label Jun 17, 2025
(ref: HTMLDivElement | null) => {
if (ref) {
// For debugging purposes, we attach the diagram to the ref.
(ref as any)._diagram = diagram;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could limit this to process.env.NODE_ENV === 'test' || process.env.APP_ENV === 'webdriverio' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, i did that in my last PR and Sergey suggested we try this (ref) approach or the one we already have (validate what user actually sees).

The one we have is failing (don't really know why, but my guess is that we are currently doing random positioning and once we have that done this may not be the issue anymore), so i am using ref approach in this PR. We also do this in codemirror to access current instance in e2e.

@mabaasit
Copy link
Contributor Author

I am merging this PR. The tests failing for the ticket are green (i also ran a patch to run data-modeling e2e tests) and its also green).

@mabaasit mabaasit merged commit 8e9c13f into main Jun 17, 2025
76 of 80 checks passed
@mabaasit mabaasit deleted the fix-diagramming-e2e-tests branch June 17, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix no release notes Fix or feature not for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants