Skip to content

Conversation

arukompas
Copy link
Contributor

Summary

  • Create new SortingMethod enum alongside deprecated FolderSortingMethod for backward compatibility
  • Replace all magic string direction values ('asc'/'desc') with SortingOrder enum constants
  • Add validateDirection() method to both FilesController and FoldersController to gracefully handle invalid direction values, defaulting to descending order
  • Add comprehensive test coverage for invalid sorting inputs in InvalidSortingValuesTest

Test Plan

  • All 273 existing tests pass
  • New validation tests verify invalid direction values default to descending
  • Verify alphabetical and time-based sorting still work correctly
  • Code formatting passes with Laravel Pint

Changes

  • ✨ Create new SortingMethod enum
  • 📝 Mark FolderSortingMethod as deprecated
  • ♻️ Replace magic strings with enum constants
  • 🛡️ Add input validation for sorting direction
  • 🧪 Add comprehensive validation tests

@arukompas arukompas self-assigned this Oct 17, 2025
@arukompas arukompas force-pushed the refactor/file-and-folder-sorting branch from 69c3a72 to 6eedba0 Compare October 17, 2025 07:07
Remove describe() function which was introduced in Pest 3.7, replacing it with
comments and flat it() declarations for backward compatibility with Pest 2.x
@arukompas arukompas merged commit 4d526de into main Oct 17, 2025
26 checks passed
@arukompas arukompas deleted the refactor/file-and-folder-sorting branch October 17, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant