-
Notifications
You must be signed in to change notification settings - Fork 7
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
(ASIM-4306) network widgets custom fonts #108
(ASIM-4306) network widgets custom fonts #108
Conversation
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.
Can we have a test for this functionality? We need at least some test to use this, to ensure future code changes don't break it unexpectedly.
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.
Will wait for a test too.
How would I go about writing a test for it? Any examples? |
The point is that changes in a library should be accompanied by a test, so if we break the functionality a test in the library will point the breakage. @prusse-martin any suggestions? |
An image test (comparing the screen shot). Another variation of the image test is using a canvas (set font and fill text then extract the pixel data from the canvas). But I will like to keep it simple. If mxgraph is shows to be "flaky" on node/label positioning we can use the canvas approach. |
Hmm I think we should move away from anything take needs the UI to work. Can't we just check that things are set on the JS side, after |
Yes we can check that... I am ready to stand down if you think we should not take this approach in this case. |
That's fine, I want more of a smoke test to ensure some refactoring just doesn't forward
Agreed.
What? I thought we are in agreement? |
Sorry if was I was not able to convey my idea. If a test "that qmx setup is happening" was in place (how it was in alfasim) during the qt port that test will happily pass. |
I disagree, we would have catch this error because we would have seen the setup failing in JS (I'm advocating to check things on the JS side, not only on the Python side). I don't want to introduce screenshot tests or anything like that because we know how flaky/hard to maintain those are, so I think at least we can meet halfway and have a test which checks the integration is happening. Do you agree, or you strongly believe we should go for a image/screenshot approach? |
Test this on JS side would be doing the "canvas" hack, due to security concerns it is not possible to check the actual font used to render in html.
I believe we should. But I will repeat. |
OK, let's go with the more complete test then. Could you tackle that in a separate PR @prusse-martin? I think this is out of @dettmerramon's expertise. Pushing the test here also works too if you prefer. 👍 |
I will work on this test later. |
By later you mean in another PR or in this one? By the way, tests are failing in this one. |
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.
Need to check why tests are failing.
Yes. I created a follow up issue for this. |
1eaecf4
to
bf7016d
Compare
Implemented the ability to load different fonts to be used in the NetworkWidget through Qmxgraph Solves ASIM-4306
for more information, see https://pre-commit.ci
Co-authored-by: Martin Prüsse <prusse.martin@gmail.com>
d9c4c54
to
3d4be6a
Compare
No description provided.