Skip to content

Commit

Permalink
Unit tests #118
Browse files Browse the repository at this point in the history
  • Loading branch information
sbs20 committed Apr 13, 2021
1 parent 7483e02 commit 0f2f91e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
42 changes: 21 additions & 21 deletions server/test/device.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Device', () => {
assert.strictEqual(device.features['-x'].default, 103);
assert.strictEqual(device.features['-y'].limits[0], 0);
assert.strictEqual(device.features['-y'].limits[1], 297);
assert.strictEqual(device.features['-y'].default, 76);
assert.strictEqual(device.features['-y'].default, 76.2);
assert.strictEqual(device.features['--brightness'].limits[0], -100);
assert.strictEqual(device.features['--brightness'].limits[1], 100);
assert.strictEqual(device.features['--brightness'].interval, 1);
Expand All @@ -47,17 +47,17 @@ describe('Device', () => {
assert.deepStrictEqual(device.features['--resolution'].options, [75, 300, 600, 1200]);
assert.strictEqual(device.features['--resolution'].default, 75);
assert.strictEqual(device.features['-l'].limits[0], 0);
assert.strictEqual(device.features['-l'].limits[1], 215);
assert.strictEqual(device.features['-l'].limits[1], 215.9);
assert.strictEqual(device.features['-l'].default, 0);
assert.strictEqual(device.features['-t'].limits[0], 0);
assert.strictEqual(device.features['-t'].limits[1], 297);
assert.strictEqual(device.features['-t'].limits[1], 297.1);
assert.strictEqual(device.features['-t'].default, 0);
assert.strictEqual(device.features['-x'].limits[0], 0);
assert.strictEqual(device.features['-x'].limits[1], 215);
assert.strictEqual(device.features['-x'].default, 215);
assert.strictEqual(device.features['-x'].limits[1], 215.9);
assert.strictEqual(device.features['-x'].default, 215.9);
assert.strictEqual(device.features['-y'].limits[0], 0);
assert.strictEqual(device.features['-y'].limits[1], 297);
assert.strictEqual(device.features['-y'].default, 297);
assert.strictEqual(device.features['-y'].limits[1], 297.1);
assert.strictEqual(device.features['-y'].default, 297.1);
assert.strictEqual(device.features['--brightness'], undefined);
assert.strictEqual(device.features['--contrast'], undefined);
});
Expand All @@ -73,13 +73,13 @@ describe('Device', () => {
assert.deepStrictEqual(device.features['--resolution'].options, [75, 300, 600, 1200]);
assert.strictEqual(device.features['--resolution'].default, 75);
assert.strictEqual(device.features['-l'].limits[0], 0);
assert.strictEqual(device.features['-l'].limits[1], 215);
assert.strictEqual(device.features['-l'].limits[1], 215.9);
assert.strictEqual(device.features['-t'].limits[0], 0);
assert.strictEqual(device.features['-t'].limits[1], 297);
assert.strictEqual(device.features['-t'].limits[1], 297.1);
assert.strictEqual(device.features['-x'].limits[0], 0);
assert.strictEqual(device.features['-x'].limits[1], 215);
assert.strictEqual(device.features['-x'].limits[1], 215.9);
assert.strictEqual(device.features['-y'].limits[0], 0);
assert.strictEqual(device.features['-y'].limits[1], 297);
assert.strictEqual(device.features['-y'].limits[1], 297.1);
assert.strictEqual(device.features['--brightness'].limits[0], -50);
assert.strictEqual(device.features['--brightness'].limits[1], 50);
assert.strictEqual(device.features['--brightness'].interval, 1);
Expand All @@ -102,13 +102,13 @@ describe('Device', () => {
assert.deepStrictEqual(device.features['--resolution'].options, [75, 100, 150, 200, 300, 600, 1200]);
assert.strictEqual(device.features['--resolution'].default, 150);
assert.strictEqual(device.features['-l'].limits[0], 0);
assert.strictEqual(device.features['-l'].limits[1], 215);
assert.strictEqual(device.features['-l'].limits[1], 215.9);
assert.strictEqual(device.features['-t'].limits[0], 0);
assert.strictEqual(device.features['-t'].limits[1], 297);
assert.strictEqual(device.features['-t'].limits[1], 297.1);
assert.strictEqual(device.features['-x'].limits[0], 0);
assert.strictEqual(device.features['-x'].limits[1], 215);
assert.strictEqual(device.features['-x'].limits[1], 215.9);
assert.strictEqual(device.features['-y'].limits[0], 0);
assert.strictEqual(device.features['-y'].limits[1], 297);
assert.strictEqual(device.features['-y'].limits[1], 297.1);
assert.strictEqual(device.features['--brightness'], undefined);
assert.strictEqual(device.features['--contrast'], undefined);
});
Expand All @@ -127,11 +127,11 @@ describe('Device', () => {
assert.strictEqual(device.features['-l'].limits[0], 0);
assert.strictEqual(device.features['-l'].limits[1], 216);
assert.strictEqual(device.features['-t'].limits[0], 0);
assert.strictEqual(device.features['-t'].limits[1], 355);
assert.strictEqual(device.features['-t'].limits[1], 355.6);
assert.strictEqual(device.features['-x'].limits[0], 0);
assert.strictEqual(device.features['-x'].limits[1], 216);
assert.strictEqual(device.features['-y'].limits[0], 0);
assert.strictEqual(device.features['-y'].limits[1], 355);
assert.strictEqual(device.features['-y'].limits[1], 355.6);
assert.strictEqual(device.features['--brightness'], undefined);
assert.strictEqual(device.features['--contrast'], undefined);
});
Expand All @@ -148,13 +148,13 @@ describe('Device', () => {
assert.deepStrictEqual(device.features['--resolution'].options, [100, 150, 200, 300, 400, 600, 1200, 2400, 4800, 9600]);
assert.strictEqual(device.features['--resolution'].default, 200);
assert.strictEqual(device.features['-l'].limits[0], 0);
assert.strictEqual(device.features['-l'].limits[1], 215);
assert.strictEqual(device.features['-l'].limits[1], 215.9);
assert.strictEqual(device.features['-t'].limits[0], 0);
assert.strictEqual(device.features['-t'].limits[1], 355);
assert.strictEqual(device.features['-t'].limits[1], 355.6);
assert.strictEqual(device.features['-x'].limits[0], 0);
assert.strictEqual(device.features['-x'].limits[1], 215);
assert.strictEqual(device.features['-x'].limits[1], 215.9);
assert.strictEqual(device.features['-y'].limits[0], 0);
assert.strictEqual(device.features['-y'].limits[1], 355);
assert.strictEqual(device.features['-y'].limits[1], 355.6);
assert.strictEqual(device.features['--brightness'], undefined);
assert.strictEqual(device.features['--contrast'], undefined);
});
Expand Down
4 changes: 2 additions & 2 deletions server/test/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ describe('Request', () => {
assert.strictEqual(request.params.resolution, '150');
assert.strictEqual(request.params.left, 0);
assert.strictEqual(request.params.top, 0);
assert.strictEqual(request.params.width, 215);
assert.strictEqual(request.params.height, 297);
assert.strictEqual(request.params.width, 215.9);
assert.strictEqual(request.params.height, 297.1);
assert.strictEqual(request.params.brightness, undefined);
assert.strictEqual(request.params.contrast, undefined);
assert.strictEqual(request.params.dynamicLineart, undefined);
Expand Down

0 comments on commit 0f2f91e

Please sign in to comment.