Yicong-Huang commented on code in PR #5071:
URL: https://github.com/apache/texera/pull/5071#discussion_r3246587613
##########
frontend/src/app/workspace/service/joint-ui/joint-ui.service.spec.ts:
##########
@@ -327,9 +327,32 @@
// });
// });
+import { JointUIService } from "./joint-ui.service";
+
describe("JointUIService", () => {
// Pre-existing spec body is commented out. Placeholder keeps Vitest's
// discovery happy; rewriting the real tests against the new test
// runner is tracked in #4861.
it.todo("add unit tests for JointUIService");
+
+ describe("truncateOperatorDisplayName", () => {
+ const max = JointUIService.MAX_OPERATOR_NAME_LENGTH;
+
+ it("returns the name unchanged when it is within the limit", () => {
+ const name = "a".repeat(max);
+ expect(JointUIService.truncateOperatorDisplayName(name)).toBe(name);
+ });
+
+ it("truncates and appends an ellipsis when the name exceeds the limit", ()
=> {
Review Comment:
Seems that we are truncating based on string length instead of pixel length.
Can we also test for non ascii names, like Chinese, they may have longer pixel
length for each character? The experience may not be good.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]