1- import { CustomModesSettingsSchema } from "../CustomModesSchema"
1+ // npx jest src/core/config/__tests__/CustomModesSettings.test.ts
2+
3+ import { customModesSettingsSchema } from "../../../schemas"
24import { ModeConfig } from "../../../shared/modes"
35import { ZodError } from "zod"
46
@@ -17,7 +19,7 @@ describe("CustomModesSettings", () => {
1719 }
1820
1921 expect ( ( ) => {
20- CustomModesSettingsSchema . parse ( validSettings )
22+ customModesSettingsSchema . parse ( validSettings )
2123 } ) . not . toThrow ( )
2224 } )
2325
@@ -27,7 +29,7 @@ describe("CustomModesSettings", () => {
2729 }
2830
2931 expect ( ( ) => {
30- CustomModesSettingsSchema . parse ( validSettings )
32+ customModesSettingsSchema . parse ( validSettings )
3133 } ) . not . toThrow ( )
3234 } )
3335
@@ -44,15 +46,15 @@ describe("CustomModesSettings", () => {
4446 }
4547
4648 expect ( ( ) => {
47- CustomModesSettingsSchema . parse ( validSettings )
49+ customModesSettingsSchema . parse ( validSettings )
4850 } ) . not . toThrow ( )
4951 } )
5052
5153 test ( "rejects missing customModes field" , ( ) => {
5254 const invalidSettings = { } as any
5355
5456 expect ( ( ) => {
55- CustomModesSettingsSchema . parse ( invalidSettings )
57+ customModesSettingsSchema . parse ( invalidSettings )
5658 } ) . toThrow ( ZodError )
5759 } )
5860
@@ -68,10 +70,10 @@ describe("CustomModesSettings", () => {
6870 }
6971
7072 expect ( ( ) => {
71- CustomModesSettingsSchema . parse ( invalidSettings )
73+ customModesSettingsSchema . parse ( invalidSettings )
7274 } ) . toThrow ( ZodError )
7375 expect ( ( ) => {
74- CustomModesSettingsSchema . parse ( invalidSettings )
76+ customModesSettingsSchema . parse ( invalidSettings )
7577 } ) . toThrow ( "Slug must contain only letters numbers and dashes" )
7678 } )
7779
@@ -81,17 +83,17 @@ describe("CustomModesSettings", () => {
8183 }
8284
8385 expect ( ( ) => {
84- CustomModesSettingsSchema . parse ( invalidSettings )
86+ customModesSettingsSchema . parse ( invalidSettings )
8587 } ) . toThrow ( ZodError )
8688 } )
8789
8890 test ( "rejects null or undefined" , ( ) => {
8991 expect ( ( ) => {
90- CustomModesSettingsSchema . parse ( null )
92+ customModesSettingsSchema . parse ( null )
9193 } ) . toThrow ( ZodError )
9294
9395 expect ( ( ) => {
94- CustomModesSettingsSchema . parse ( undefined )
96+ customModesSettingsSchema . parse ( undefined )
9597 } ) . toThrow ( ZodError )
9698 } )
9799
@@ -104,7 +106,7 @@ describe("CustomModesSettings", () => {
104106 }
105107
106108 expect ( ( ) => {
107- CustomModesSettingsSchema . parse ( duplicateSettings )
109+ customModesSettingsSchema . parse ( duplicateSettings )
108110 } ) . toThrow ( "Duplicate mode slugs are not allowed" )
109111 } )
110112
@@ -119,7 +121,7 @@ describe("CustomModesSettings", () => {
119121 }
120122
121123 expect ( ( ) => {
122- CustomModesSettingsSchema . parse ( invalidSettings )
124+ customModesSettingsSchema . parse ( invalidSettings )
123125 } ) . toThrow ( ZodError )
124126 } )
125127
@@ -134,7 +136,7 @@ describe("CustomModesSettings", () => {
134136 }
135137
136138 expect ( ( ) => {
137- CustomModesSettingsSchema . parse ( validSettings )
139+ customModesSettingsSchema . parse ( validSettings )
138140 } ) . not . toThrow ( )
139141 } )
140142 } )
0 commit comments