Closed Bug 1965832 Opened 1 month ago Closed 1 month ago

Remove static mocking of org.mozilla.fenix.ext.BookmarkNodeKt used in BookmarkItemMenuTest

Categories

(Firefox for Android :: Bookmarks, task)

All
Android
task

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: mcarare, Assigned: mcarare)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group6] )

Attachments

(1 file, 1 obsolete file)

We should extract bookmarks child checking into a separate method to remove static mocking of org.mozilla.fenix.ext.BookmarkNodeKt.

The Bugbug bot thinks this bug should belong to the 'Firefox for Android::Bookmarks' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Bookmarks

This commit also refactors the code generating the bookmark item menu to be more readable:

  • Replace listOfNotNull with buildList for creating the menu options.
  • Introduce helper variables for each menu option.

The checkAtLeastOneChild function is only relevant for BookmarkNodeType.FOLDER. This change ensures the function is not called unnecessarily for other types.

Attachment #9487086 - Attachment description: Bug 1965832 - Add a `checkAtLeastOneChild` function to improve testability of menu item creation. → Bug 1965832 - Add a `checkAtLeastOneChild` method and inject bookmarksStorage to improve testability of menu item creation.
Attachment #9487087 - Attachment is obsolete: true
Pushed by mcarare@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/59c36992320d Add a `checkAtLeastOneChild` method and inject bookmarksStorage to improve testability of menu item creation. r=android-reviewers,pollymce
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: