Paulus Schoutsen cdb2093ea6
Ts all the tests (#1998)
* Convert tests to TypeScript

* Add types for tests

* Rename files to TS

* Fix up test imports

* Fix TSC errors

* Liiiint

* Add types to util method signatures

* Some more types
2018-11-06 10:09:09 +01:00

38 lines
864 B
TypeScript

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));
});
});