File tree Expand file tree Collapse file tree
packages/types/src/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import {
2+ DEFAULT_DESTRUCTIVE_COMMAND_GUARD_ENABLED ,
3+ GLOBAL_SETTINGS_KEYS ,
4+ globalSettingsSchema ,
5+ } from "../global-settings.js"
6+
7+ describe ( "destructive command guard global setting" , ( ) => {
8+ it ( "is opt-in by default" , ( ) => {
9+ expect ( DEFAULT_DESTRUCTIVE_COMMAND_GUARD_ENABLED ) . toBe ( false )
10+ } )
11+
12+ it ( "accepts and exposes the persisted setting" , ( ) => {
13+ expect ( globalSettingsSchema . parse ( { destructiveCommandGuardEnabled : true } ) ) . toEqual ( {
14+ destructiveCommandGuardEnabled : true ,
15+ } )
16+ expect ( GLOBAL_SETTINGS_KEYS ) . toContain ( "destructiveCommandGuardEnabled" )
17+ } )
18+
19+ it ( "rejects non-boolean setting values" , ( ) => {
20+ expect ( ( ) => globalSettingsSchema . parse ( { destructiveCommandGuardEnabled : "true" } ) ) . toThrow ( )
21+ } )
22+ } )
You can’t perform that action at this time.
0 commit comments