Merge "Revert "Don't display tooltips on touch devices""

This commit is contained in:
Andrew Bonventre
2016-10-18 21:19:03 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 56 deletions

View File

@@ -430,45 +430,5 @@ limitations under the License.
MockInteractions.tap(element.$$('.send'));
});
});
test('don"t display tooltips on touch devices', function() {
element.labels = {
Verified: {
values: {
'-1': 'Fails',
' 0': 'No score',
'+1': 'Verified'
},
default_value: 0
},
'Code-Review': {
values: {
'-2': 'Do not submit',
'-1': 'I would prefer that you didn\'t submit this',
' 0': 'No score',
'+1': 'Looks good to me, but someone else must approve',
'+2': 'Looks good to me, approved'
},
default_value: 0
}
};
var verifiedBtn = element.$$(
'iron-selector[data-label="Verified"] > ' +
'gr-button[data-value="-1"]');
// On touch devices, tooltips should not be shown
verifiedBtn._isTouchDevice = true;
verifiedBtn._handleShowTooltip();
assert.isNotOk(verifiedBtn._tooltip);
verifiedBtn._handleHideTooltip();
assert.isNotOk(verifiedBtn._tooltip);
// On other devices, tooltips should be shown.
verifiedBtn._isTouchDevice = false;
verifiedBtn._handleShowTooltip();
assert.isOk(verifiedBtn._tooltip);
verifiedBtn._handleHideTooltip();
assert.isNotOk(verifiedBtn._tooltip);
});
});
</script>