Merge pull request #3938 from NativeScript/fix-border-and-corner-radius-tests

The asserted border and corner radius values were not rounded, we now round on dip to px conversion
This commit is contained in:
Panayot Cankov
2017-04-06 09:52:05 +03:00
committed by GitHub

View File

@ -809,7 +809,7 @@ export function testSetInlineStyle() {
export function testBorderWidth() {
helper.buildUIAndRunTest(_createLabelWithBorder(), function (views: Array<View>) {
const lbl = views[0];
const expectedValue = <number>lbl.borderWidth * utils.layout.getDisplayDensity();
const expectedValue = Math.round(<number>lbl.borderWidth * utils.layout.getDisplayDensity());
const actualValue = definition.getUniformNativeBorderWidth(lbl);
TKUnit.assertAreClose(actualValue, expectedValue, 0.01, "borderWidth");
});
@ -819,7 +819,7 @@ export function testCornerRadius() {
helper.buildUIAndRunTest(_createLabelWithBorder(), function (views: Array<View>) {
const lbl = views[0];
TKUnit.waitUntilReady(() => lbl.isLayoutValid);
const expectedValue = <number>lbl.borderRadius * utils.layout.getDisplayDensity();
const expectedValue = Math.round(<number>lbl.borderRadius * utils.layout.getDisplayDensity());
const actualValue = definition.getUniformNativeCornerRadius(lbl);
TKUnit.assertAreClose(actualValue, expectedValue, 0.01, "borderRadius");
});