mirror of
https://github.com/home-assistant/frontend.git
synced 2026-05-08 17:28:46 +01:00
34bfc12647
* Add prettier * Apply Prettier
38 lines
847 B
JavaScript
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));
|
|
});
|
|
});
|