Skip to content

Conversation

@terrerox
Copy link
Contributor

@terrerox terrerox commented Dec 17, 2025

Description

Add unit tests for date service, version history hooks, and file version service to ensure
reliability of the file versioning functionality. Tests cover dropdown positioning logic, version
history menu configuration, file version operations, and date utility functions including expiration
calculations.

Related Issues

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Additional Notes

@terrerox terrerox marked this pull request as draft December 17, 2025 21:28
@terrerox terrerox self-assigned this Dec 17, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 17, 2025

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0a418b4
Status:🚫  Build failed.

View logs

@terrerox terrerox force-pushed the feature/file-version-history-v5 branch from c356206 to af92c23 Compare December 17, 2025 22:47
@terrerox terrerox changed the base branch from master to feature/file-version-history-v4 December 18, 2025 03:46
@terrerox terrerox changed the title Feature/file version history v5 [PB-5542]: File history tests Dec 18, 2025
@terrerox terrerox changed the title [PB-5542]: File history tests [PB-5542]: File version history tests Dec 18, 2025
Add unit tests for date service, version history hooks, and file version service to ensure
reliability of the file versioning functionality. Tests cover dropdown positioning logic, version
history menu configuration, file version operations, and date utility functions including expiration
calculations.
@terrerox terrerox force-pushed the feature/file-version-history-v5 branch from af92c23 to 700735a Compare December 18, 2025 04:40
@terrerox terrerox marked this pull request as ready for review December 18, 2025 04:50
@terrerox terrerox requested a review from xabg2 as a code owner December 18, 2025 04:50
Copy link
Collaborator

@CandelR CandelR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests seems okay, but it will need minor changes to follow the test structure that we are using now.
Avoid using technical names like function or variable names (getDaysUntilExpiration, useDropdownPositioning, etc.), use natural language instead that describes what's happening from a user perspective.
Use the "when X, then Y" format, this makes tests read like specifications. It clearly separates the condition from the expected outcome, making tests easier to understand and maintain.
These days I will try to upload the guidelines so that everything is well explained in the project itself :)

@terrerox terrerox requested a review from CandelR December 22, 2025 23:27
});

it('opens below when there is room', async () => {
it('when there is room below the item, then the menu opens below', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what means with room?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means “if there’s space.” I’ve changed it for clarity

});
});

it('returns unlocked config when versioning is enabled and extension allowed', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to change this tests descriptions

@terrerox terrerox requested a review from CandelR December 23, 2025 13:20
@sonarqubecloud
Copy link

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.

3 participants