Skip to content

Commit

Permalink
update tests for updated voltage-to-percentage calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenKelevra committed Sep 2, 2024
1 parent 43b8b42 commit 56cb839
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ describe('lib/utils.js', () => {
});

it('gets non-linear', () => {
expect(utils.batteryVoltageToPercentage(2300, '3V_2100')).toStrictEqual(4);
expect(utils.batteryVoltageToPercentage(3000, '3V_2100')).toStrictEqual(100);
expect(utils.batteryVoltageToPercentage(2600, '3V_2100')).toStrictEqual(0);
expect(utils.batteryVoltageToPercentage(2700, '3V_2100')).toStrictEqual(10);
expect(utils.batteryVoltageToPercentage(2800, '3V_2100')).toStrictEqual(40);
expect(utils.batteryVoltageToPercentage(2900, '3V_2100')).toStrictEqual(70);
expect(utils.batteryVoltageToPercentage(3000, '3V_2100')).toStrictEqual(90);
expect(utils.batteryVoltageToPercentage(3200, '3V_2100')).toStrictEqual(100);
expect(utils.batteryVoltageToPercentage(2000, '3V_2100')).toStrictEqual(0);

expect(utils.batteryVoltageToPercentage(2300, '3V_1500_2800')).toStrictEqual(74);
Expand Down

0 comments on commit 56cb839

Please sign in to comment.