Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Ensuring that pinned publishers are not unpinned when decimal values are entered for the pin percentage #13267

Merged
merged 1 commit into from
Feb 23, 2018

Conversation

ryanml
Copy link
Contributor

@ryanml ryanml commented Feb 23, 2018

Fixes #12001

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

1. Enable payments, visit few sites to add it to ledger
2. Pin 3-4 sites in the ledger table
3. Change one of the pinned site value to random decimal value
4. Ensure site value changes to 1 and stays pinned.

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

This is a very simple fix for the issues of decimal values unpinning a pinned publisher.

Inside the PinnedInput component, the callback for onBlur was interpreting decimal values less than 1 as falsey, causing them to be unpinned. This performs an additional check ensuring those cases are accounted for.

cc: @NejcZdovc

@codecov-io
Copy link

codecov-io commented Feb 23, 2018

Codecov Report

Merging #13267 into master will decrease coverage by 0.03%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master   #13267      +/-   ##
==========================================
- Coverage   55.93%   55.89%   -0.04%     
==========================================
  Files         281      281              
  Lines       27856    27856              
  Branches     4571     4571              
==========================================
- Hits        15580    15571       -9     
- Misses      12276    12285       +9
Flag Coverage Δ
#unittest 55.89% <0%> (-0.04%) ⬇️
Impacted Files Coverage Δ
...erer/components/preferences/payment/pinnedInput.js 51.35% <0%> (ø) ⬆️
js/stores/appStoreRenderer.js 91.66% <0%> (-8.34%) ⬇️
app/renderer/components/reduxComponent.js 57.75% <0%> (-3.45%) ⬇️
js/stores/windowStore.js 27.65% <0%> (-0.3%) ⬇️

@NejcZdovc NejcZdovc added this to the 0.23.x (Nightly Channel) milestone Feb 23, 2018
Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

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

++ looks good. Great work 🎉

@NejcZdovc NejcZdovc merged commit a2b0f91 into brave:master Feb 23, 2018
@ryanml
Copy link
Contributor Author

ryanml commented Feb 23, 2018

Thanks @NejcZdovc!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding decimal value to pinned site cause it to unpin
3 participants