Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26791] Windows: Ti.UI.View reports top/left/bottom/right values as Strings always

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2019-05-09T01:36:08.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.1.0
ComponentsWindows
Labelsn/a
ReporterChristopher Williams
AssigneeKota Iguchi
Created2019-02-01T18:57:56.000+0000
Updated2019-05-09T01:36:08.000+0000

Description

I'm in the process of updating our test suite to use the latest should.js library, which now uses a stricter equality check. As a result, the tests are now flagging a number of windows UI tests as failing due to comparisons against expected numeric values. (the comparison used to do == but now do === so won't coerce to Number) Turns out we're reporting string values for top/left/right/bottom always on Windows where we report Numbers on Android/iOS. The properties themselves are Number or String, so Strings can be valid but would typically be reported when followed by the "unit" (i.e. "px", "em", "%"). For parity's sake, I think it'd be good to report the values as Numbers when they're purely numeric/have no units explicitly attached.

Attachments

FileDateSize
Screen Shot 2019-02-01 at 1.54.36 PM.png2019-02-01T18:54:54.000+0000121604

Comments

  1. Christopher Williams 2019-02-01

    so far, looks like these properties have this issue: - Ti.UI.View.top - Ti.UI.View.left - Ti.UI.View.right - Ti.UI.View.bottom - Ti.UI.View.center.x - Ti.UI.View.center.y - Ti.UI.View.height - Font.fontSize I assume Ti.UI.View.width also has this issue? Note that Ti.UI.rect properties are Numbers correctly.
  2. Kota Iguchi 2019-03-22

    https://github.com/appcelerator/titanium_mobile_windows/pull/1370
  3. Samir Mohammed 2019-04-10

    FR Passed, waiting on Jenkins.
  4. Kota Iguchi 2019-04-12

    Merged to master.

JSON Source