photoprism/frontend/tests/unit/options/options_test.js

46 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-10-08 16:16:34 +00:00
import "../fixtures";
import * as options from "../../../src/options/options";
let chai = require("chai/chai");
let assert = chai.assert;
describe("options/options", () => {
it("should get timezones", () => {
const timezones = options.TimeZones();
assert.equal(timezones[0].Name, "UTC");
assert.equal(timezones[1].Name, "Local Time");
});
it("should get days", () => {
const Days = options.Days();
assert.equal(Days[0].text, "01");
assert.equal(Days[30].text, "31");
});
it("should get years", () => {
const Years = options.Years();
2022-01-03 10:18:48 +00:00
const currentYear = new Date().getUTCFullYear();
assert.equal(Years[0].text, currentYear);
2021-10-08 16:16:34 +00:00
});
it("should get indexed years", () => {
const IndexedYears = options.IndexedYears();
assert.equal(IndexedYears[0].text, "2021");
});
it("should get months", () => {
const Months = options.Months();
assert.equal(Months[5].text, "June");
});
it("should get short months", () => {
const MonthsShort = options.MonthsShort();
assert.equal(MonthsShort[5].text, "06");
});
it("should get languages", () => {
const Languages = options.Languages();
assert.equal(Languages[0].value, "en");
2021-10-08 16:16:34 +00:00
});
});