forked from Blendman974/faceclaw
Merge upstream main preserving custom feature integrations
This commit is contained in:
commit
6150a1ac57
228 files changed
+16844
-1388
No files matched your search
@@ -36,6 +36,14 @@ test('the display mode starts as the middle band, or carries over the old mode a
|
||||
assert.equal(api.displayLayoutSetting.get(), 'band-bottom');
|
||||
});
|
||||
|
||||
test('the glasses model name follows the paired glasses type', () => {
|
||||
const model = (entries) => settingsFixture(new Map(entries)).glassesModelName();
|
||||
assert.equal(model([]), 'G2');
|
||||
assert.equal(model([['deviceType', 'g2']]), 'G2');
|
||||
assert.equal(model([['deviceType', 'g1']]), 'G1');
|
||||
assert.equal(model([['deviceType', 'rayneo-io']]), 'iO');
|
||||
});
|
||||
|
||||
test('per-app display modes carry over their old mode and position where the merged values can say it', () => {
|
||||
const app = (appId, entries) => settingsFixture(new Map(entries))[`${appId}DisplayLayoutSetting`].get();
|
||||
assert.equal(app('navigate', []), 'global');
|
||||
@@ -94,3 +102,49 @@ test('keep awake persists per app independently of full screen, including existi
|
||||
prefs = settingsFixture(store);
|
||||
assert.equal(prefs.appKeepAwakeSetting('terminal').get(), false);
|
||||
});
|
||||
|
||||
test('a RayNeo iO defaults the app switcher to the left, and keeps a chosen position and the band', () => {
|
||||
const store = new Map();
|
||||
const api = settingsFixture(store);
|
||||
assert.equal(api.appSwitcherPositionSetting.get(), 'bottom');
|
||||
api.glassesTypeSetting.set('rayneo-io');
|
||||
assert.equal(api.appSwitcherPositionSetting.get(), 'left');
|
||||
assert.equal(api.displayLayoutSetting.get(), 'band-middle');
|
||||
assert.equal(store.has('display.appSwitcherPosition'), false);
|
||||
// A stored position is the user's, on either glasses.
|
||||
api.appSwitcherPositionSetting.set('right');
|
||||
assert.equal(api.appSwitcherPositionSetting.get(), 'right');
|
||||
api.glassesTypeSetting.set('g2');
|
||||
assert.equal(api.appSwitcherPositionSetting.get(), 'right');
|
||||
store.delete('display.appSwitcherPosition');
|
||||
assert.equal(api.appSwitcherPositionSetting.get(), 'bottom');
|
||||
// An unknown stored value falls back to the glasses' default.
|
||||
store.set('display.appSwitcherPosition', 'sideways');
|
||||
api.glassesTypeSetting.set('rayneo-io');
|
||||
assert.equal(api.appSwitcherPositionSetting.get(), 'left');
|
||||
});
|
||||
|
||||
test('a RayNeo iO always takes the R1 directly, leaving the G2\'s ring connection setting alone', () => {
|
||||
const store = new Map();
|
||||
const api = settingsFixture(store);
|
||||
assert.equal(api.effectiveRingConnectionMode(), 'glasses');
|
||||
api.ringConnectionModeSetting.set('health');
|
||||
assert.equal(api.effectiveRingConnectionMode(), 'health');
|
||||
api.glassesTypeSetting.set('rayneo-io');
|
||||
assert.equal(api.effectiveRingConnectionMode(), 'direct');
|
||||
assert.equal(api.ringConnectionModeSetting.get(), 'health');
|
||||
api.glassesTypeSetting.set('g2');
|
||||
assert.equal(api.effectiveRingConnectionMode(), 'health');
|
||||
});
|
||||
|
||||
test('only a G2 has a compass', () => {
|
||||
const api = settingsFixture();
|
||||
assert.equal(api.glassesHaveCompass(), true);
|
||||
api.glassesTypeSetting.set('g1');
|
||||
assert.equal(api.glassesHaveCompass(), false);
|
||||
api.glassesTypeSetting.set('rayneo-io');
|
||||
assert.equal(api.glassesHaveCompass(), false);
|
||||
api.glassesTypeSetting.set('g2');
|
||||
assert.equal(api.glassesHaveCompass(), true);
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user