test(FitPlugin): simplify container dimension setup by redfish4ktc · Pull Request #1079 · maxGraph/maxGraph · GitHub
Skip to content

test(FitPlugin): simplify container dimension setup#1079

Merged
redfish4ktc merged 2 commits into
mainfrom
test/simplify_FitPlugin.test
May 27, 2026
Merged

test(FitPlugin): simplify container dimension setup#1079
redfish4ktc merged 2 commits into
mainfrom
test/simplify_FitPlugin.test

Conversation

@redfish4ktc

@redfish4ktc redfish4ktc commented May 27, 2026

Copy link
Copy Markdown

Summary

  • Replace the four repetitive Object.defineProperty blocks (one per container dimension) with a single loop iterating over Object.entries(dimensions).
  • Reduces duplication in the test helper that sets up container dimensions, removing 21 lines while keeping behavior identical.

Test plan

  • npm test -w packages/core -- FitPlugin.test (17 tests pass)

Summary by CodeRabbit

  • Tests
    • Refactored a test helper that sets container dimensions for cleaner implementation; behavior unchanged — falsy numeric inputs (e.g., 0) remain skipped during testing.

Review Change Stack

Replace repetitive Object.defineProperty calls with a loop to reduce
code duplication when setting up container dimensions in tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@redfish4ktc redfish4ktc added the refactor Code refactoring label May 27, 2026
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@redfish4ktc redfish4ktc merged commit 7f2e169 into main May 27, 2026
14 checks passed
@redfish4ktc redfish4ktc deleted the test/simplify_FitPlugin.test branch May 27, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant