mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
* Tests: convert all common tests from mocha to karma * Tests: refactor Vuetify setup in tests * Tests: update package-lock.json * Tests: convert all model test to vitest 1/2 * Tests: convert all model test to vitest 2/2 * Tests: fix broken test * Tests: time zone UTC * Tests: Add playwright screenshots folder to gitignore * Tests: Add timezone to vitest scripts * Tests: Add Vitest scripts to Makefile * Tests: delete unused timezone configs * Tests: Update some tests * Tests: Update vitest config * Tests: Delete usesless try-catch
25 lines
1000 B
JavaScript
25 lines
1000 B
JavaScript
import { describe, it, expect } from 'vitest';
|
|
import "../fixtures";
|
|
import Settings from "model/settings";
|
|
|
|
describe("model/settings", () => {
|
|
it("should return if key was changed", () => {
|
|
const model = new Settings({ ui: { language: "de", scrollbar: false } });
|
|
expect(model.changed("ui", "scrollbar")).toBe(false);
|
|
expect(model.changed("ui", "language")).toBe(false);
|
|
});
|
|
|
|
it("should load settings", async () => {
|
|
const model = new Settings({ ui: { language: "de", scrollbar: false } });
|
|
const response = await model.load();
|
|
expect(response["ui"]["scrollbar"]).toBe(false);
|
|
expect(response["ui"]["language"]).toBe("de");
|
|
});
|
|
|
|
it("should save settings", async () => {
|
|
const model = new Settings({ ui: { language: "de", scrollbar: false } });
|
|
const response = await model.save();
|
|
expect(response["ui"]["scrollbar"]).toBe(false);
|
|
expect(response["ui"]["language"]).toBe("de");
|
|
});
|
|
}); |