Skip to content

Commit

Permalink
test(android): attempt snapshot validation of tint
Browse files Browse the repository at this point in the history
  • Loading branch information
garymathews committed Nov 3, 2020
1 parent 1d82d3c commit 67d4783
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/Resources/ti.ui.tabgroup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,48 @@ describe('Titanium.UI.TabGroup', function () {
tabGroup.open();
});

it.android('icon and title tint - android bottom style', finish => {
this.timeout(5000);

tabGroup = Ti.UI.createTabGroup({
style: Ti.UI.Android.TABS_STYLE_BOTTOM_NAVIGATION
});
const tab_a = Ti.UI.createTab({
icon: '/SmallLogo.png',
title: 'TAB A',
titleColor: 'red',
activeTitleColor: 'blue',
window: Ti.UI.createWindow({ backgroundColor: 'gray' })
});
const tab_b = Ti.UI.createTab({
icon: '/SmallLogo.png',
title: 'TAB B',
tintColor: 'red',
activeTintColor: 'blue',
window: Ti.UI.createWindow({ backgroundColor: 'gray' })
});

tabGroup.addEventListener('open', () => {
try {
const image = tabGroup.toImage();
const navImage = image.imageAsCropped({
width: image.width,
height: 150,
y: image.height - 274
});

should(navImage).matchImage('snapshots/tabGroup_bottomNavigation.png');
} catch (e) {
return finish(e);
}
finish();
});

tabGroup.addTab(tab_a);
tabGroup.addTab(tab_b);
tabGroup.open();
});

describe('closed/focused', () => {
beforeEach(() => {
tabGroup = Ti.UI.createTabGroup();
Expand Down

0 comments on commit 67d4783

Please sign in to comment.