1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Use browser default time and number formatting with polyfills if needed (#9481)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Bram Kragten
2021-09-30 01:34:52 +02:00
committed by GitHub
parent d7f00df391
commit 1bccbd4173
91 changed files with 952 additions and 974 deletions

View File

@@ -0,0 +1,28 @@
import { assert } from "chai";
import { DEFAULT_VIEW_ENTITY_ID } from "../../../src/common/const";
import { extractViews } from "../../../src/common/entity/extract_views";
import { createEntities, createView } from "./test_util";
describe("extractViews", () => {
it("should work", () => {
const entities = createEntities(10);
const view1 = createView({ attributes: { order: 10 } });
entities[view1.entity_id] = view1;
const view2 = createView({ attributes: { order: 2 } });
entities[view2.entity_id] = view2;
const view3 = createView({
entity_id: DEFAULT_VIEW_ENTITY_ID,
attributes: { order: 8 },
});
entities[view3.entity_id] = view3;
const view4 = createView({ attributes: { order: 4 } });
entities[view4.entity_id] = view4;
const expected = [view3, view2, view4, view1];
assert.deepEqual(expected, extractViews(entities));
});
});