mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 18:06:36 +00:00
Fix common tests (#14485)
This commit is contained in:
parent
90a7c2d2ff
commit
40d0455936
@ -72,7 +72,7 @@ describe("formatTimeWeekday", () => {
|
|||||||
time_format: TimeFormat.am_pm,
|
time_format: TimeFormat.am_pm,
|
||||||
first_weekday: FirstWeekday.language,
|
first_weekday: FirstWeekday.language,
|
||||||
}),
|
}),
|
||||||
"Wednesday 11:12 PM"
|
"Saturday 11:12 PM"
|
||||||
);
|
);
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
formatTimeWeekday(dateObj, {
|
formatTimeWeekday(dateObj, {
|
||||||
@ -81,7 +81,7 @@ describe("formatTimeWeekday", () => {
|
|||||||
time_format: TimeFormat.twenty_four,
|
time_format: TimeFormat.twenty_four,
|
||||||
first_weekday: FirstWeekday.language,
|
first_weekday: FirstWeekday.language,
|
||||||
}),
|
}),
|
||||||
"Wednesday 23:12"
|
"Saturday 23:12"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -108,7 +108,7 @@ describe("computeStateDisplay", () => {
|
|||||||
};
|
};
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
computeStateDisplay(localize, stateObj, localeData),
|
computeStateDisplay(localize, stateObj, localeData),
|
||||||
"1,234.5 m"
|
"1,234.5"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ describe("computeStateDisplay", () => {
|
|||||||
describe("Localizes input_datetime with full date time", () => {
|
describe("Localizes input_datetime with full date time", () => {
|
||||||
const stateObj: any = {
|
const stateObj: any = {
|
||||||
entity_id: "input_datetime.test",
|
entity_id: "input_datetime.test",
|
||||||
state: "123",
|
state: "2017-11-18 23:12:00",
|
||||||
attributes: {
|
attributes: {
|
||||||
has_date: true,
|
has_date: true,
|
||||||
has_time: true,
|
has_time: true,
|
||||||
@ -203,7 +203,7 @@ describe("computeStateDisplay", () => {
|
|||||||
it("Localizes input_datetime with date", () => {
|
it("Localizes input_datetime with date", () => {
|
||||||
const stateObj: any = {
|
const stateObj: any = {
|
||||||
entity_id: "input_datetime.test",
|
entity_id: "input_datetime.test",
|
||||||
state: "123",
|
state: "2017-11-18",
|
||||||
attributes: {
|
attributes: {
|
||||||
has_date: true,
|
has_date: true,
|
||||||
has_time: false,
|
has_time: false,
|
||||||
@ -224,7 +224,7 @@ describe("computeStateDisplay", () => {
|
|||||||
describe("Localizes input_datetime with time", () => {
|
describe("Localizes input_datetime with time", () => {
|
||||||
const stateObj: any = {
|
const stateObj: any = {
|
||||||
entity_id: "input_datetime.test",
|
entity_id: "input_datetime.test",
|
||||||
state: "123",
|
state: "23:12:00",
|
||||||
attributes: {
|
attributes: {
|
||||||
has_date: false,
|
has_date: false,
|
||||||
has_time: true,
|
has_time: true,
|
||||||
|
@ -4,6 +4,9 @@ const path = require("path");
|
|||||||
process.env.TZ = "Etc/UTC";
|
process.env.TZ = "Etc/UTC";
|
||||||
process.env.IS_TEST = "true";
|
process.env.IS_TEST = "true";
|
||||||
|
|
||||||
|
global.window = {};
|
||||||
|
global.navigator = {};
|
||||||
|
|
||||||
const MDI_OUTPUT_DIR = path.resolve(__dirname, "../build/mdi");
|
const MDI_OUTPUT_DIR = path.resolve(__dirname, "../build/mdi");
|
||||||
|
|
||||||
if (!fs.existsSync(MDI_OUTPUT_DIR)) {
|
if (!fs.existsSync(MDI_OUTPUT_DIR)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user