mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-24 04:39:01 +00:00
* Move computeDomain and format functions to js * Add tests for computeStateDisplay * Always recalculate state display * Remove LANGUAGE from hassUtils object * Move AppLocalizeBehavior import to mixins * Import mixins to state-card-display * Safety check on computeStateDisplay * Don't store computed domains on stateObj * Integration tests for state-card-display * Include extractDomain code in polymer repo * Remove util function null checking * Dont render test element without hass and stateObj * Revert "Don't store computed domains on stateObj" This reverts commite3509d7182. * Revert "Always recalculate state display" This reverts commit27c24e2694.
13 lines
317 B
JavaScript
13 lines
317 B
JavaScript
import computeDomain from '../../../js/common/util/compute_domain';
|
|
|
|
const assert = require('assert');
|
|
|
|
describe('computeDomain', function() {
|
|
it('Detects sensor domain', function() {
|
|
const stateObj = {
|
|
entity_id: 'sensor.test',
|
|
};
|
|
assert.strictEqual(computeDomain(stateObj), 'sensor');
|
|
});
|
|
});
|