Skip to content

Commit

Permalink
test: expand testing of Ti.UI.View.borderRadius
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Jul 7, 2020
1 parent 1f64289 commit bcfe70b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions tests/Resources/ti.ui.view.addontest.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ describe('Titanium.UI.View', function () {
}
});

describe.only('borderRadius corners', () => {
// NOTE: We're very careful to use exact pixel values that are divisble by 1, 2 and 3
// so that varying device dpi don't alter expectations for snapshot image comparisons
describe('borderRadius corners', () => {
// FIXME: Due to very slow performance, I'm not turning on the image comparisons right now
// We need to speed up the code (presumably Buffer)
// const density = Ti.Platform.displayCaps.logicalDensityFactor;
// FIXME: Don't use dp/pts in the actual radii so we can avoid needing separate images per density?
// Do separate tests for verifying use of pts/dp versus density?

it('4 values in String', finish => {
win = Ti.UI.createWindow({ backgroundColor: 'blue' });
Expand All @@ -64,7 +67,7 @@ describe('Titanium.UI.View', function () {
try {
should(view.borderRadius).be.a.String();
should(view.borderRadius).eql('12px 12 12dp 12');
should(outerView).matchImage('snapshots/borderRadius12p_x12_12dp_12.png');
// should(outerView).matchImage(`snapshots/borderRadius12px_12_12dp_12_${density}x.png`);
} catch (e) {
return finish(e);
}
Expand Down Expand Up @@ -94,8 +97,9 @@ describe('Titanium.UI.View', function () {
try {
should(view.borderRadius).be.an.Array();
should(view.borderRadius.length).eql(4);
should(view.borderRadius).eql([ '12px', 12, '12dp', '12' ]);
// should be the exact same as above
should(outerView).matchImage('snapshots/borderRadius12px_12_12dp_12.png');
// should(outerView).matchImage(`snapshots/borderRadius12px_12_12dp_12_${density}x.png`);
} catch (err) {
return finish(err);
}
Expand Down Expand Up @@ -126,7 +130,7 @@ describe('Titanium.UI.View', function () {
try {
should(view.borderRadius).be.a.String();
should(view.borderRadius).eql('12px 12');
should(outerView).matchImage('snapshots/borderRadius12px_12.png');
// should(outerView).matchImage(`snapshots/borderRadius12px_12_${density}x.png`);
} catch (e) {
return finish(e);
}
Expand Down Expand Up @@ -158,7 +162,7 @@ describe('Titanium.UI.View', function () {
should(view.borderRadius.length).eql(2);
should(view.borderRadius).eql([ '12px', 12 ]);
// should be the exact same as above
should(outerView).matchImage('snapshots/borderRadius12px_12.png');
// should(outerView).matchImage(`snapshots/borderRadius12px_12_${density}x.png`);
} catch (err) {
return finish(err);
}
Expand Down

0 comments on commit bcfe70b

Please sign in to comment.