githubbob42 / mingle2github2

0 stars 1 forks source link

Format Percent helper does not Render 0.00% #4783

Closed githubbob42 closed 7 years ago

githubbob42 commented 7 years ago

Mingle Card: 5131 Steps to Reproduce

| | |
|-|-|
|**Version #**|V4 Beta (3745)|
|**Hardware**| |
|**OS**| |
|**Browser**|Chrome|
|**Username**|mdeville@johnzink.com.full|
|**Password**|Use LastPass|
|ORG ID| |
|User ID| |
|RayGun Error ID| |

Synopsis**: **John Zink has a ticket form called CEMS which has quite a few Percent fields. If the user puts in 0% in one of the Percent fields the HTML renders that field as blank instead of the 0.00%. This is the same in back office as well as mobile. 

  1. Go to Ticket T-9B3-A3D-559A
  2. Go to Forms Click on the CEMS-003 Form.
  3. In the details find one of the Propane 1st Run LOW Ca Readings under the Propane Cylinder Gas Audit LOW section and place 0% in one of the 3 reading fields

!clip-e432-13df.png!

  1. Go to the reports and render the report. The 0.00% will render blank  as seen below.

!clip-b2c7-d37f.png!

Expected Result

What should happen?

Actual Result

What actually happens?

Analysis

This report is in HTML. Will this be fixed in a single helper fix or do we need to fix it in 2 places?  We will need to fix this in back office as well.

We were bailing out of the formatPercent helper using a blind negative test:

if (!field) return ‘’;

Unfortunately, zero is falsey, so if the value is zero, we return an empty string instead of formatting the value.  Check for null/undefined instead.

Related Cards

Test Plan

{{formatPercent FX5__Discount_Percent__c decimalPlaces="2"}}

githubbob42 commented 7 years ago

Godswill : 06/13/2017 09:38 CDT Test Result: Passed PR Build: 4.0.1.pr2417 Admin User: qaadmin@test4.com Hardware: MacBook Pro OS: MacOS 10.12.5 Browser: Version 58.0.3029.110 (64-bit) URL: https://hunterpeak.herokuapp.com Test Case: 5131 Reproduction Steps Test Notes: When a 0% is enter on the percent fields, the HTML renders that field as 0.00%

githubbob42 commented 7 years ago

Pull Request #2417