1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-05-08 17:28:46 +01:00
Files
frontend/test-mocha/common/entity/has_location.test.js
T
Paulus Schoutsen 34bfc12647 Prettier 💎 (#1737)
* Add prettier

* Apply Prettier
2018-10-11 12:22:11 +02:00

38 lines
847 B
JavaScript

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