PG1204 opened a new pull request, #6403:
URL: https://github.com/apache/texera/pull/6403
### What changes were proposed in this PR?
Adds unit test coverage for the calculateTotalTranslate3d function in
[frontend/src/app/common/util/panel-dock.ts](vscode-webview://1epki5h79lmkghv36u4evg54fuvmk17ndjca203mcg7opnnd5sg9/frontend/src/app/common/util/panel-dock.ts),
which was previously untested. This is a pure function that parses one or more
CSS translate3d(...) fragments from a string and returns the component-wise sum
of their x/y/z offsets.
A new spec file, frontend/src/app/common/util/panel-dock.spec.ts, was
created following the testing style of size-formatter.util.spec.ts. It covers:
- Parsing a single translate3d(...) fragment
- Summing multiple concatenated fragments component-wise
- Decimal pixel values
- Negative pixel values
- Returning [0, 0, 0] when no translate3d(...) pattern is present
- A fragment missing px units, which does not match the parser and
contributes [0, 0, 0]
### Any related issues, documentation, discussions?
Closes #6255
### How was this PR tested?
Added 6 unit tests in the new spec file, all passing via ng test:
cd frontend && npx ng test --watch=false --include='**/panel-dock.spec.ts'
src/app/common/util/panel-dock.spec.ts (6 tests) 3ms
Test Files - 1, passed (1)
Tests - 6, passed (6)
### Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF
--
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]