-
Notifications
You must be signed in to change notification settings - Fork 228
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
Conversation
const diagram = useDiagram(); | ||
|
||
const setDiagramContainerRef = useCallback( | ||
(ref: HTMLDivElement) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(ref: HTMLDivElement) => { | |
(ref: HTMLDivElement | null) => { |
…b-js/compass into fix-diagramming-e2e-tests
(ref: HTMLDivElement | null) => { | ||
if (ref) { | ||
// For debugging purposes, we attach the diagram to the ref. | ||
(ref as any)._diagram = diagram; |
There was a problem hiding this comment.
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'
?
There was a problem hiding this comment.
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.
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). |
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes