summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2015-09-21 15:11:03 -0700
committerPhilip Chimento <philip@endlessm.com>2015-09-21 15:19:08 -0700
commiteae80fce8f28293e6a7af8b450f15c2948e786d9 (patch)
treee41078d8141a29e61cab113b3b9890fd1d522bbe /test
parentef0813bc6d013efde371a8e621316930b07d5f79 (diff)
Fix faulty floating point math in test
Not sure why this never failed before, but in some tests we were asserting that a floating point number was equal to an integer. Instead assert that they are equal within 0 decimal places. [endlessm/eos-sdk#3634]
Diffstat (limited to 'test')
-rw-r--r--test/webhelper/testUpdateFontSize.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/webhelper/testUpdateFontSize.js b/test/webhelper/testUpdateFontSize.js
index 8bd26be..dd45d6f 100644
--- a/test/webhelper/testUpdateFontSize.js
+++ b/test/webhelper/testUpdateFontSize.js
@@ -61,7 +61,8 @@ describe("Web Helper Font Sizes", function () {
it("does not have the default font scale for a tiny window", function () {
let test_initial_font_size = function (my_win, default_font_size) {
my_win.font_scaling_default_window_size = 200; // Force a ridiculous value
- expect(my_win.font_scaling_calculated_font_size).not.toEqual(default_font_size);
+ // Window's font scaling is a double, web settings' is an integer
+ expect(my_win.font_scaling_calculated_font_size).not.toBeCloseTo(default_font_size, 0);
/* This does not immediately quit the application. It sets a flag for termination
* which will cause the application to be disposed on the next main loop iteration. */
@@ -79,7 +80,8 @@ describe("Web Helper Font Sizes", function () {
app.set_font_resizable_callback = app.set_web_settings_font_resizable;
let test_font_sizing = function (my_win, my_websettings) {
- expect(my_win.font_scaling_calculated_font_size).toEqual(my_websettings.default_font_size);
+ // Window's font scaling is a double, web settings' is an integer
+ expect(my_win.font_scaling_calculated_font_size).toBeCloseTo(my_websettings.default_font_size, 0);
/* This does not immediately quit the application. It sets a flag for termination
* which will cause the application to be disposed on the next main loop iteration. */