✅ Fix JS Unit tests & add one
This commit is contained in:
1 parent
c837cb6d94
commit
6e57ab6b23
2 files changed
+9
-1
No files matched your search
@@ -655,7 +655,7 @@ function cleanTemperature(temp, offThreshold) {
|
||||
}
|
||||
|
||||
function formatTemperature(temp, showF, offThreshold, returnUnicode) {
|
||||
if (temp === undefined || isNaN(temp)) return "-";
|
||||
if (temp === undefined || !_.isNumber(temp) || isNaN(temp)) return "-";
|
||||
if (offThreshold !== undefined && temp < offThreshold) return gettext("off");
|
||||
|
||||
var degreeSymbol = "°";
|
||||
|
||||
@@ -105,6 +105,14 @@ QUnit.cases(
|
||||
offThreshold: undefined,
|
||||
expected: "-"
|
||||
},
|
||||
{
|
||||
title: "NaNTemperature",
|
||||
input: NaN,
|
||||
showF: undefined,
|
||||
useUnicode: undefined,
|
||||
offThreshold: undefined,
|
||||
expected: "-"
|
||||
},
|
||||
{
|
||||
title: "TemperatureUnderOffThreshold",
|
||||
input: 1.0,
|
||||
|
||||
Reference in new issue
Block a user