Skip to content

Commit

Permalink
test(android): removed test code for API Level less than 21
Browse files Browse the repository at this point in the history
  • Loading branch information
jquick-axway authored and sgtcoolguy committed Dec 15, 2020
1 parent f2c6803 commit aa9c9b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 33 deletions.
11 changes: 4 additions & 7 deletions tests/Resources/intl.datetimeformat.test.js
Expand Up @@ -136,13 +136,10 @@ describe('Intl.DateTimeFormat', () => {
const date = new Date(Date.UTC(2020, 0, 1, 12, 0, 0, 456));
let formatter = new Intl.DateTimeFormat('en-US', { fractionalSecondDigits: 3, timeZone: 'UTC' });
should(formatter.format(date)).be.eql('456');
if (Ti.Platform.Android.API_LEVEL >= 21) {
// Only Android 5.0+ correctly formats with these settings.
formatter = new Intl.DateTimeFormat('en-US', { fractionalSecondDigits: 2, timeZone: 'UTC' });
should(formatter.format(date)).be.eql('45');
formatter = new Intl.DateTimeFormat('en-US', { fractionalSecondDigits: 1, timeZone: 'UTC' });
should(formatter.format(date)).be.eql('4');
}
formatter = new Intl.DateTimeFormat('en-US', { fractionalSecondDigits: 2, timeZone: 'UTC' });
should(formatter.format(date)).be.eql('45');
formatter = new Intl.DateTimeFormat('en-US', { fractionalSecondDigits: 1, timeZone: 'UTC' });
should(formatter.format(date)).be.eql('4');
});
});

Expand Down
5 changes: 0 additions & 5 deletions tests/Resources/ti.android.r.test.js
Expand Up @@ -1818,11 +1818,6 @@ describe.android('Titanium.Android.R', () => {
});

describe('.transition', () => {
// Only supported on Android API 21+
if (Ti.Platform.Android.API_LEVEL < 21) {
return;
}

it('is a Object', () => {
should(Ti.Android.R).have.a.readOnlyProperty('transition').which.is.a.Object();
});
Expand Down
29 changes: 8 additions & 21 deletions tests/Resources/ti.ui.view.test.js
Expand Up @@ -1035,9 +1035,7 @@ describe('Titanium.UI.View', function () {
try {
should(view.borderRadius).be.a.String();
should(view.borderRadius).eql('12px 12 12dp 12');
if (!OS_ANDROID || Ti.Platform.Android.API_LEVEL > 20) {
should(outerView).matchImage('snapshots/borderRadius_12px_12_12dp_12.png');
}
should(outerView).matchImage('snapshots/borderRadius_12px_12_12dp_12.png');
} catch (e) {
return finish(e);
}
Expand All @@ -1063,11 +1061,9 @@ describe('Titanium.UI.View', function () {
should(view.borderRadius).be.an.Array();
should(view.borderRadius.length).eql(4);
should(view.borderRadius).eql([ '12px', 12, '12dp', '12' ]);
if (!OS_ANDROID || Ti.Platform.Android.API_LEVEL > 20) {

// Exact same image as test above.
should(outerView).matchImage('snapshots/borderRadius_12px_12_12dp_12.png');
}
// Exact same image as test above.
should(outerView).matchImage('snapshots/borderRadius_12px_12_12dp_12.png');
} catch (err) {
return finish(err);
}
Expand All @@ -1093,11 +1089,8 @@ describe('Titanium.UI.View', function () {
should(view.borderRadius).be.a.String();
should(view.borderRadius).eql('12px 12');

if (!OS_ANDROID || Ti.Platform.Android.API_LEVEL > 20) {

// Exact same image as test above.
should(outerView).matchImage('snapshots/borderRadius_12px_12.png');
}
// Exact same image as test above.
should(outerView).matchImage('snapshots/borderRadius_12px_12.png');
} catch (e) {
return finish(e);
}
Expand All @@ -1124,11 +1117,8 @@ describe('Titanium.UI.View', function () {
should(view.borderRadius.length).eql(2);
should(view.borderRadius).eql([ '12px', 12 ]);

if (!OS_ANDROID || Ti.Platform.Android.API_LEVEL > 20) {

// Exact same image as test above.
should(outerView).matchImage('snapshots/borderRadius_12px_12.png');
}
// Exact same image as test above.
should(outerView).matchImage('snapshots/borderRadius_12px_12.png');
} catch (err) {
return finish(err);
}
Expand Down Expand Up @@ -1186,10 +1176,7 @@ describe('Titanium.UI.View', function () {
try {
should(view.borderRadius).be.a.String();
should(view.borderRadius).eql('30px');

if (!OS_ANDROID || Ti.Platform.Android.API_LEVEL > 20) {
should(outerView).matchImage('snapshots/borderRadius_30px.png');
}
should(outerView).matchImage('snapshots/borderRadius_30px.png');
} catch (e) {
return finish(e);
}
Expand Down

0 comments on commit aa9c9b4

Please sign in to comment.