mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-19 18:28:42 +00:00
Entity dropdown improvement (#674)
* Ignore hass changes while dropdown is open * Upgrade vaadin-combo-box * Fix styling on dev-service panel * Fix styling for ha-entity-dropdown * Fix height vaadin-combo-box dropdown * Rename ha-entity-dropdown to ha-entity-picker * More entity improvement (#675) * Update script and automation editor to use entity picker * Add entity and service picker to service dev panel * Lint
This commit is contained in:
38
test-mocha/common/util/location.js
Normal file
38
test-mocha/common/util/location.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import { hasLocation } from '../../../js/common/util/location';
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
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));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user