-
Notifications
You must be signed in to change notification settings - Fork 88
Fix/sch pin spacing box width #1580
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4d445ce to
72b1220
Compare
| import { test, expect } from "bun:test" | ||
| import { getAllDimensionsForSchematicBox } from "lib/utils/schematic/getAllDimensionsForSchematicBox" | ||
|
|
||
| test("schPinSpacing should not change the width of the schematic box", () => { | ||
| // Test with different pin spacings but same port arrangement | ||
| const baseParams = { | ||
| schPortArrangement: { | ||
| leftSize: 2, | ||
| rightSize: 2, | ||
| topSize: 2, | ||
| bottomSize: 2, | ||
| }, | ||
| pinCount: 8, | ||
| numericSchPinStyle: {}, | ||
| } | ||
|
|
||
| // Get dimensions with default spacing (0.2) | ||
| const dims1 = getAllDimensionsForSchematicBox({ | ||
| ...baseParams, | ||
| schPinSpacing: 0.2, | ||
| }) | ||
| const size1 = dims1.getSize() | ||
|
|
||
| // Get dimensions with larger spacing (0.5) | ||
| const dims2 = getAllDimensionsForSchematicBox({ | ||
| ...baseParams, | ||
| schPinSpacing: 0.5, | ||
| }) | ||
| const size2 = dims2.getSize() | ||
|
|
||
| // Get dimensions with even larger spacing (1.0) | ||
| const dims3 = getAllDimensionsForSchematicBox({ | ||
| ...baseParams, | ||
| schPinSpacing: 1.0, | ||
| }) | ||
| const size3 = dims3.getSize() | ||
|
|
||
| console.log("Width with spacing 0.2:", size1.width) | ||
| console.log("Width with spacing 0.5:", size2.width) | ||
| console.log("Width with spacing 1.0:", size3.width) | ||
| console.log("Height with spacing 0.2:", size1.height) | ||
| console.log("Height with spacing 0.5:", size2.height) | ||
| console.log("Height with spacing 1.0:", size3.height) | ||
|
|
||
| // Width should remain constant regardless of pin spacing | ||
| expect(size1.width).toBe(size2.width) | ||
| expect(size2.width).toBe(size3.width) | ||
|
|
||
| // Height is expected to change with spacing (left/right pins) | ||
| expect(size1.height).toBeLessThan(size2.height) | ||
| expect(size2.height).toBeLessThan(size3.height) | ||
| }) |
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.
The test file name 'repro-schPinSpacing-changes-box-width.test.tsx' is inconsistent with the project's naming conventions. The file contains only one test function, but uses a very long descriptive name instead of following the kebab-case pattern or matching export names as specified in the file naming rule. Consider renaming to a shorter, more consistent name like 'sch-pin-spacing-box-width.test.tsx' or similar kebab-case format that aligns with the project's naming conventions.
Spotted by Graphite Agent (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
72b1220 to
67d7a04
Compare
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.
some workflows failed
fixes: #1576
/claim #1576
before:

after:
