Skip to content

refactor: standardize spec test files#827

Closed
tilucasoli wants to merge 2 commits intomainfrom
refactor/standardize-spec-tests
Closed

refactor: standardize spec test files#827
tilucasoli wants to merge 2 commits intomainfrom
refactor/standardize-spec-tests

Conversation

@tilucasoli
Copy link
Copy Markdown
Collaborator

Related issue

Standardization of test file structure across the codebase.

Description

This PR standardizes all spec test files to follow the pattern established in box_spec_test.dart. It ensures consistency in naming, structure, and organization of spec tests.

Changes

  • Create flex_spec_test.dart following the box_spec_test.dart pattern with full test coverage
  • Fix group names in spec test files (was incorrectly labeled as MutableStyler or Style instead of Spec):
    • icon_spec_test.dart: IconMutableStylerIconSpec
    • image_spec_test.dart: ImageMutableStylerImageSpec
    • stack_spec_test.dart: StackStyleStackSpec
  • Add proper test names (replaced empty strings with descriptive names):
    • 'creates [Spec] with all properties'
    • 'creates [Spec] with default values'
    • 'interpolates between two [Spec]s correctly'
  • Move spec tests to their respective directories for better organization:
    • stack_spec_test.dartstack/stack_spec_test.dart
    • zbox_spec_test.dartstack/stackbox_spec_test.dart
    • text_spec_test.darttext/text_spec_test.dart
  • Ensure consistent structure across all spec tests with groups:
    • Constructor
    • copyWith
    • lerp
    • equality
    • debugFillProperties
    • props
    • Real-world scenarios

Review Checklist

  • Testing: Have you tested your changes, including unit tests and integration tests for affected code?
  • Breaking Changes: Does this change introduce breaking changes affecting existing code or users?
  • Documentation Updates: Are all relevant documentation files (e.g. README, API docs) updated to reflect the changes in this PR?
  • Website Updates: Is the website containing the updates you make on documentation?

Additional Information (optional)

This is a refactoring PR that only affects test files. No production code changes.

- Update controlling-widget-state.mdx tutorial to explain that hover/press work automatically but focus requires Pressable
- Add docstrings to onFocused methods explaining the Pressable requirement
- Update dynamic-styling.mdx and box.mdx with minor improvements
- Update simple_box example
- Create flex_spec_test.dart following the box_spec_test.dart pattern
- Fix group names in icon_spec_test.dart, image_spec_test.dart, stack_spec_test.dart
- Add proper test names (replace empty strings with descriptive names)
- Move spec tests to their respective directories:
  - stack_spec_test.dart -> stack/stack_spec_test.dart
  - zbox_spec_test.dart -> stack/stackbox_spec_test.dart
  - text_spec_test.dart -> text/text_spec_test.dart
- Ensure consistent structure: Constructor, copyWith, lerp, equality, debugFillProperties, props, Real-world scenarios
@docs-page
Copy link
Copy Markdown

docs-page Bot commented Jan 9, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/mix~827

Documentation is deployed and generated using docs.page.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
mix-docs Ready Ready Preview, Comment Jan 9, 2026 2:13am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation examples mix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant