[Settings] Refactor: change createPasswordEntry(); set id's in tests
With the addition of new fields to the PasswordUiEntry type over time, this helper function (used to create mock data for tests) was modified to set default values to these fields, since they were not relevant for most tests. Once deduplication happens in passwords_section though, only duplicates will be allowed to share the value of frontendId, which is problematic. In order to avoid having several optional parameters in an fixed order, this CL changes the signature to receive them in a key/value manner. When no frontendId is passed, it assumes the value of the id. This allows tests that do not care about duplicate entries to simply set the id value. Besides that, the CL also touches existing tests that did not set id values (which was inconsistent with the production code anyway). This will allow adding the deduplication functionality in crrev.com/c/2219503 without touching these tests, but rather focusing on adding tests for the new behavior. Bug: 1049141 Change-Id: If773b2684eda844dc025fea6255288215cd66bdf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218055 Commit-Queue: Victor Vianna <victorvianna@google.com> Reviewed-by:Friedrich [CET] <fhorschig@chromium.org> Cr-Commit-Position: refs/heads/master@{#773095}
Showing
This diff is collapsed.
Please register or sign in to comment