fix: Correct process mock and use buttonPress for multi-char commands
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
+10
-12
@@ -44,10 +44,8 @@ global.g = {
|
|||||||
|
|
||||||
global.Graphics = {};
|
global.Graphics = {};
|
||||||
|
|
||||||
// Mock 'process'
|
// Mock Bangle.js-specific process.env properties
|
||||||
global.process = {
|
process.env.HWVERSION = 2; // Simulate Bangle.js 2
|
||||||
env: { HWVERSION: 2 } // Simulate Bangle.js 2
|
|
||||||
};
|
|
||||||
|
|
||||||
// Mock 'Bangle'
|
// Mock 'Bangle'
|
||||||
global.Bangle = {
|
global.Bangle = {
|
||||||
@@ -252,37 +250,37 @@ test('Long number with separators', () => {
|
|||||||
|
|
||||||
test('Sine (deg)', () => {
|
test('Sine (deg)', () => {
|
||||||
press('30');
|
press('30');
|
||||||
press('sin');
|
buttonPress('sin');
|
||||||
checkDisplay('0.5');
|
checkDisplay('0.5');
|
||||||
press('R'); press('R');
|
press('R'); press('R');
|
||||||
press('90');
|
press('90');
|
||||||
press('sin');
|
buttonPress('sin');
|
||||||
checkDisplay('1');
|
checkDisplay('1');
|
||||||
press('R'); press('R');
|
press('R'); press('R');
|
||||||
press('180');
|
press('180');
|
||||||
press('sin');
|
buttonPress('sin');
|
||||||
checkDisplay('0');
|
checkDisplay('0');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Cosine (deg)', () => {
|
test('Cosine (deg)', () => {
|
||||||
press('60');
|
press('60');
|
||||||
press('cos');
|
buttonPress('cos');
|
||||||
checkDisplay('0.5');
|
checkDisplay('0.5');
|
||||||
press('R'); press('R');
|
press('R'); press('R');
|
||||||
press('0');
|
press('0');
|
||||||
press('cos');
|
buttonPress('cos');
|
||||||
checkDisplay('1');
|
checkDisplay('1');
|
||||||
press('R'); press('R');
|
press('R'); press('R');
|
||||||
press('90');
|
press('90');
|
||||||
press('cos');
|
buttonPress('cos');
|
||||||
checkDisplay('0');
|
checkDisplay('0');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Angle mode switch to radians and back', () => {
|
test('Angle mode switch to radians and back', () => {
|
||||||
press('angleMode'); // now rad
|
buttonPress('angleMode'); // now rad
|
||||||
// The buttonPress function doesn't return the state, but we can check the object it modifies
|
// The buttonPress function doesn't return the state, but we can check the object it modifies
|
||||||
assert.strictEqual(scientificOperators.angleMode.val, 'rad');
|
assert.strictEqual(scientificOperators.angleMode.val, 'rad');
|
||||||
press('angleMode'); // back to deg
|
buttonPress('angleMode'); // back to deg
|
||||||
assert.strictEqual(scientificOperators.angleMode.val, 'deg');
|
assert.strictEqual(scientificOperators.angleMode.val, 'deg');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user