@@ -2,30 +2,10 @@ import { describe, expect, it } from "vitest";
22import { Schema } from "effect" ;
33
44import { ProviderInstanceId } from "./providerInstance.ts" ;
5- import {
6- MAX_SIDEBAR_THREAD_PREVIEW_COUNT ,
7- MIN_SIDEBAR_THREAD_PREVIEW_COUNT ,
8- SidebarThreadPreviewCount ,
9- DEFAULT_SERVER_SETTINGS ,
10- ServerSettings ,
11- ServerSettingsPatch ,
12- } from "./settings.ts" ;
5+ import { DEFAULT_SERVER_SETTINGS , ServerSettings , ServerSettingsPatch } from "./settings.ts" ;
136
147const decodeServerSettings = Schema . decodeUnknownSync ( ServerSettings ) ;
158const decodeServerSettingsPatch = Schema . decodeUnknownSync ( ServerSettingsPatch ) ;
16- const decodeSidebarThreadPreviewCount = Schema . decodeUnknownSync ( SidebarThreadPreviewCount ) ;
17-
18- describe ( "SidebarThreadPreviewCount" , ( ) => {
19- it ( "accepts the configured 1-15 range" , ( ) => {
20- expect ( decodeSidebarThreadPreviewCount ( MIN_SIDEBAR_THREAD_PREVIEW_COUNT ) ) . toBe ( 1 ) ;
21- expect ( decodeSidebarThreadPreviewCount ( MAX_SIDEBAR_THREAD_PREVIEW_COUNT ) ) . toBe ( 15 ) ;
22- } ) ;
23-
24- it ( "rejects values outside the configured range" , ( ) => {
25- expect ( ( ) => decodeSidebarThreadPreviewCount ( MIN_SIDEBAR_THREAD_PREVIEW_COUNT - 1 ) ) . toThrow ( ) ;
26- expect ( ( ) => decodeSidebarThreadPreviewCount ( MAX_SIDEBAR_THREAD_PREVIEW_COUNT + 1 ) ) . toThrow ( ) ;
27- } ) ;
28- } ) ;
299
3010describe ( "ServerSettings.providerInstances (slice-2 invariant)" , ( ) => {
3111 it ( "defaults to an empty record so legacy configs without the key still decode" , ( ) => {
0 commit comments