mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-19 18:28:42 +00:00
Move all of hassUtil to JS (#1153)
* Move all of hassUtil to JS * Fix tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import durationToSeconds from '../../../js/common/util/duration_to_seconds.js';
|
||||
import durationToSeconds from '../../../js/common/datetime/duration_to_seconds.js';
|
||||
|
||||
describe('durationToSeconds', () => {
|
||||
it('works', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import formatDate from '../../../js/common/util/format_date';
|
||||
import formatDate from '../../../js/common/datetime/format_date';
|
||||
|
||||
describe('formatDate', () => {
|
||||
const dateObj = new Date(
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import formatDateTime from '../../../js/common/util/format_date_time';
|
||||
import formatDateTime from '../../../js/common/datetime/format_date_time';
|
||||
|
||||
describe('formatDateTime', () => {
|
||||
const dateObj = new Date(
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import formatTime from '../../../js/common/util/format_time';
|
||||
import formatTime from '../../../js/common/datetime/format_time';
|
||||
|
||||
describe('formatTime', () => {
|
||||
const dateObj = new Date(
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import secondsToDuration from '../../../js/common/util/seconds_to_duration.js';
|
||||
import secondsToDuration from '../../../js/common/datetime/seconds_to_duration.js';
|
||||
|
||||
describe('secondsToDuration', () => {
|
||||
it('works', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import attributeClassNames from '../../../js/common/util/attribute_class_names';
|
||||
import attributeClassNames from '../../../js/common/entity/attribute_class_names';
|
||||
|
||||
describe('attributeClassNames', () => {
|
||||
const attrs = ['mock_attr1', 'mock_attr2'];
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import canToggleDomain from '../../../js/common/util/can_toggle_domain';
|
||||
import canToggleDomain from '../../../js/common/entity/can_toggle_domain';
|
||||
|
||||
describe('canToggleDomain', () => {
|
||||
const hass = {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import canToggleState from '../../../js/common/util/can_toggle_state';
|
||||
import canToggleState from '../../../js/common/entity/can_toggle_state';
|
||||
|
||||
describe('canToggleState', () => {
|
||||
const hass = {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import computeDomain from '../../../js/common/util/compute_domain';
|
||||
import computeDomain from '../../../js/common/entity/compute_domain';
|
||||
|
||||
describe('computeDomain', () => {
|
||||
it('Returns domains', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import computeStateDisplay from '../../../js/common/util/compute_state_display';
|
||||
import computeStateDisplay from '../../../js/common/entity/compute_state_display';
|
||||
|
||||
describe('computeStateDisplay', () => {
|
||||
const localize = function (message, ...args) {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import computeStateDomain from '../../../js/common/util/compute_state_domain.js';
|
||||
import computeStateDomain from '../../../js/common/entity/compute_state_domain.js';
|
||||
|
||||
describe('computeStateDomain', () => {
|
||||
it('Detects sensor domain', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import featureClassNames from '../../../js/common/util/feature_class_names';
|
||||
import featureClassNames from '../../../js/common/entity/feature_class_names';
|
||||
|
||||
describe('featureClassNames', () => {
|
||||
const classNames = {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { hasLocation } from '../../../js/common/util/location';
|
||||
import hasLocation from '../../../js/common/entity/has_location.js';
|
||||
|
||||
describe('hasLocation', () => {
|
||||
it('flags states with location', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import stateCardType from '../../../js/common/util/state_card_type';
|
||||
import stateCardType from '../../../js/common/entity/state_card_type.js';
|
||||
|
||||
describe('stateCardType', () => {
|
||||
const hass = {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
|
||||
import stateMoreInfoType from '../../../js/common/util/state_more_info_type';
|
||||
import stateMoreInfoType from '../../../js/common/entity/state_more_info_type.js';
|
||||
|
||||
describe('stateMoreInfoType', () => {
|
||||
it('Returns media_player for media_player states', () => {
|
||||
@@ -1,7 +1,7 @@
|
||||
import { assert } from 'chai';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import timerTimeRemaining from '../../../js/common/util/timer_time_remaining.js';
|
||||
import timerTimeRemaining from '../../../js/common/entity/timer_time_remaining.js';
|
||||
|
||||
describe('timerTimeRemaining', () => {
|
||||
it('works with idle timers', () => {
|
||||
Reference in New Issue
Block a user