-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathappSettings.test.ts
More file actions
43 lines (32 loc) · 1.45 KB
/
appSettings.test.ts
File metadata and controls
43 lines (32 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import * as Schema from "effect/Schema";
import { describe, expect, it } from "vitest";
import { AppSettingsSchema, DEFAULT_PR_REVIEW_REQUEST_CHANGES_TONE } from "./appSettings";
describe("AppSettingsSchema", () => {
it("defaults codeViewerAutosave to false", () => {
const settings = Schema.decodeUnknownSync(AppSettingsSchema)({});
expect(settings.codeViewerAutosave).toBe(false);
});
it("defaults notification detail toggles to false", () => {
const settings = Schema.decodeUnknownSync(AppSettingsSchema)({});
expect(settings.showNotificationDetails).toBe(false);
expect(settings.includeDiagnosticsTipsInCopy).toBe(false);
});
it("preserves an explicit codeViewerAutosave setting", () => {
const settings = Schema.decodeUnknownSync(AppSettingsSchema)({
codeViewerAutosave: true,
});
expect(settings.codeViewerAutosave).toBe(true);
});
it("preserves explicit notification detail settings", () => {
const settings = Schema.decodeUnknownSync(AppSettingsSchema)({
showNotificationDetails: true,
includeDiagnosticsTipsInCopy: true,
});
expect(settings.showNotificationDetails).toBe(true);
expect(settings.includeDiagnosticsTipsInCopy).toBe(true);
});
it("defaults the PR request changes button tone to warning", () => {
const settings = Schema.decodeUnknownSync(AppSettingsSchema)({});
expect(settings.prReviewRequestChangesTone).toBe(DEFAULT_PR_REVIEW_REQUEST_CHANGES_TONE);
});
});