aglinxinyuan opened a new issue, #6255:
URL: https://github.com/apache/texera/issues/6255
### Task Summary
Add `panel-dock.spec.ts` covering `calculateTotalTranslate3d`, which sums
the x/y/z offsets across one or more `translate3d(...)` CSS fragments in a
string.
## Background
`frontend/src/app/common/util/panel-dock.ts` exports
`calculateTotalTranslate3d`. It finds every `translate3d(...)` fragment in the
input string and adds up their component offsets, returning a `[x, y, z]`
tuple. It is pure (regex + arithmetic) and untested.
```ts
export function calculateTotalTranslate3d(translates: string): [number,
number, number] {
// sums each translate3d(x, y, z) match; returns [0, 0, 0] when there are
none
}
```
## Behavior to pin
| Input | Result |
| --- | --- |
| `"translate3d(10px, -5px, 0px)"` | `[10, -5, 0]` |
| two concatenated `translate3d(...)` fragments | component-wise sum |
| decimal / negative px values | parsed correctly (e.g. `1.5px`, `-20px`) |
| a string with no `translate3d(...)` | `[0, 0, 0]` |
Follow `size-formatter.util.spec.ts` in `common/util/` as the style template
(plain `describe`/`it`/`expect`, run with `ng test`).
## Scope
- New spec: `frontend/src/app/common/util/panel-dock.spec.ts`.
- No production-code changes.
### Task Type
- [ ] Refactor / Cleanup
- [ ] DevOps / Deployment / CI
- [x] Testing / QA
- [ ] Documentation
- [ ] Performance
- [ ] Other
--
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]