Skip to content

Tests: Replace confusing assertLessThan with explicit comparisons in admin menu order test#47420

Draft
Copilot wants to merge 15 commits intotrunkfrom
copilot/sub-pr-47417
Draft

Tests: Replace confusing assertLessThan with explicit comparisons in admin menu order test#47420
Copilot wants to merge 15 commits intotrunkfrom
copilot/sub-pr-47417

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

PHPUnit's assertLessThan($expected, $actual) signature is counterintuitive — the first argument is the upper bound, not the value being tested as "less than" — making it easy to misread the assertions as testing the opposite order.

Change

Replaced assertLessThan calls with assertTrue + explicit inequality expressions, making the comparison direction immediately obvious:

// Before — confusing: which arg is "less than"?
$this->assertLessThan( $backup_submenu_position, $videopress_submenu_position, '...' );

// After — unambiguous
$this->assertTrue( $videopress_submenu_position < $backup_submenu_position, '...' );

Applies to all four ordering assertions: VideoPress → Backup → Search → Settings → Activity Log. Test semantics are unchanged.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

DevinWalker and others added 14 commits March 2, 2026 14:58
Adjusts the menu positions for Jetpack admin menu items to place all links that open in new windows (external links marked with ↗) after internal links. This improves the user experience by grouping similar link types together.

Changes:
- Activity Log: moved from position 8 to 14
- Subscribers: moved from position 11 to 15
- Jetpack Manage: moved from position 15 to 16
- Scan & VaultPress Backup (external): base offset changed from 9 to 17
- Updated test to verify external links appear after Settings

Internal links (Settings at position 13) now appear before all external links.

Made-with: Cursor
Replace @automattic/jetpack-components Button with @wordpress/components Button in the BackupNowButton component for better consistency with WordPress core components.

Changes:
- Updated import to use @wordpress/components Button
- Removed custom weight prop (not supported by WordPress Button)
- Updated variant default to 'solid'
- Added size='compact' prop for appropriate button sizing

Made-with: Cursor
Simplify Jetpack admin menu item titles for better readability:
- "Akismet Anti-spam" → "Anti-spam"
- "VaultPress Backup" → "Backups"

These shorter titles provide a cleaner menu experience while maintaining clarity about the product functionality.

Made-with: Cursor
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changed the variant prop in the BackupNowButton component from 'primary', 'secondary', 'tertiary' to 'solid', 'outline', 'minimal', 'unstyled' for improved flexibility in button styling.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…dule.scss

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: DevinWalker <1571635+DevinWalker@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on Admin Menu navigation improvements Tests: Replace confusing assertLessThan with explicit comparisons in admin menu order test Mar 3, 2026
Base automatically changed from update/header-and-nav-cleanup-and-improvements to trunk March 3, 2026 09:00
@github-actions github-actions bot added [Feature] Scan [JS Package] Components [Package] Admin Ui [Package] Backup [Package] My Jetpack [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress labels Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Review, ...).
  • 🔴 Add testing instructions.
  • 🔴 Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so:

## Testing instructions:

* Go to '..'
*

🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so:

## Does this pull request change what data or activity we track or use?

My PR adds *x* and *y*.

Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Scan [JS Package] Components [Package] Admin Ui [Package] Backup [Package] My Jetpack [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants