1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-19 18:28:42 +00:00

Use browser default time and number formatting with polyfills if needed (#9481)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Bram Kragten
2021-09-30 01:34:52 +02:00
committed by GitHub
parent d7f00df391
commit 1bccbd4173
91 changed files with 952 additions and 974 deletions

View File

@@ -0,0 +1,37 @@
import { assert } from "chai";
import { hasLocation } from "../../../src/common/entity/has_location";
describe("hasLocation", () => {
it("flags states with location", () => {
const stateObj: any = {
attributes: {
latitude: 12.34,
longitude: 12.34,
},
};
assert(hasLocation(stateObj));
});
it("does not flag states with only latitude", () => {
const stateObj: any = {
attributes: {
latitude: 12.34,
},
};
assert(!hasLocation(stateObj));
});
it("does not flag states with only longitude", () => {
const stateObj: any = {
attributes: {
longitude: 12.34,
},
};
assert(!hasLocation(stateObj));
});
it("does not flag states with no location", () => {
const stateObj: any = {
attributes: {},
};
assert(!hasLocation(stateObj));
});
});