#108 Fix colorpicker for Diorite

This commit is contained in:
Grégoire Sage
2016-07-08 14:56:45 -07:00
committed by Keegan Lillo
parent ae31f9737f
commit 5d6e070e01
2 changed files with 25 additions and 2 deletions
+3 -2
View File
@@ -116,12 +116,13 @@ module.exports = {
function autoLayout() { function autoLayout() {
if (!clay.meta.activeWatchInfo || if (!clay.meta.activeWatchInfo ||
clay.meta.activeWatchInfo.firmware.major === 2 || clay.meta.activeWatchInfo.firmware.major === 2 ||
clay.meta.activeWatchInfo.platform === 'aplite' && ['aplite', 'diorite'].indexOf(clay.meta.activeWatchInfo.platform) > -1 &&
!self.config.allowGray) { !self.config.allowGray) {
return standardLayouts.BLACK_WHITE; return standardLayouts.BLACK_WHITE;
} }
if (clay.meta.activeWatchInfo.platform === 'aplite' && self.config.allowGray) { if (['aplite', 'diorite'].indexOf(clay.meta.activeWatchInfo.platform) > -1 &&
self.config.allowGray) {
return standardLayouts.GRAY; return standardLayouts.GRAY;
} }
+22
View File
@@ -434,6 +434,28 @@ describe('component - color', function() {
suffix: '' suffix: ''
} }
}); });
testAutoLayout('diorite', standardLayouts.BLACK_WHITE, false, '', {
platform: 'diorite',
model: 'qemu_platform_diorite',
language: 'en_US',
firmware: {
major: 4,
minor: 0,
patch: 0,
suffix: ''
}
});
testAutoLayout('diorite', standardLayouts.GRAY, true, '', {
platform: 'diorite',
model: 'qemu_platform_diorite',
language: 'en_US',
firmware: {
major: 4,
minor: 0,
patch: 0,
suffix: ''
}
});
testCustomLayout(); testCustomLayout();
testCustomLayout('COLOR'); testCustomLayout('COLOR');