Skip to content

Commit 585a174

Browse files
committed
One more test update
1 parent 8102b3f commit 585a174

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

frontend/src/components/pages/knowledgebase/create/schemas.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('KnowledgeBaseCreateFormSchema', () => {
4747
});
4848

4949
if (!result.success) {
50-
console.error('Validation errors:', JSON.stringify(result.error.errors, null, 2));
50+
console.error('Validation errors:', JSON.stringify(result.error.issues, null, 2));
5151
}
5252

5353
expect(result.success).toBe(true);
@@ -74,7 +74,7 @@ describe('KnowledgeBaseCreateFormSchema', () => {
7474

7575
expect(result.success).toBe(false);
7676
if (!result.success) {
77-
const tableError = result.error.errors.find((err) => err.path[0] === 'postgresTable');
77+
const tableError = result.error.issues.find((err) => err.path[0] === 'postgresTable');
7878
expect(tableError?.message).toContain('must start with a letter');
7979
}
8080
});
@@ -87,7 +87,7 @@ describe('KnowledgeBaseCreateFormSchema', () => {
8787

8888
expect(result.success).toBe(false);
8989
if (!result.success) {
90-
const tableError = result.error.errors.find((err) => err.path[0] === 'postgresTable');
90+
const tableError = result.error.issues.find((err) => err.path[0] === 'postgresTable');
9191
expect(tableError?.message).toContain('must start with a letter');
9292
}
9393
});
@@ -103,7 +103,7 @@ describe('KnowledgeBaseCreateFormSchema', () => {
103103

104104
expect(result.success, `Expected "${tableName}" to be invalid`).toBe(false);
105105
if (!result.success) {
106-
const tableError = result.error.errors.find((err) => err.path[0] === 'postgresTable');
106+
const tableError = result.error.issues.find((err) => err.path[0] === 'postgresTable');
107107
expect(tableError?.message).toContain('must start with a letter');
108108
}
109109
}
@@ -117,7 +117,7 @@ describe('KnowledgeBaseCreateFormSchema', () => {
117117

118118
expect(result.success).toBe(false);
119119
if (!result.success) {
120-
const tableError = result.error.errors.find((err) => err.path[0] === 'postgresTable');
120+
const tableError = result.error.issues.find((err) => err.path[0] === 'postgresTable');
121121
expect(tableError?.message).toBeTruthy();
122122
}
123123
});
@@ -153,7 +153,7 @@ describe('KnowledgeBaseCreateFormSchema', () => {
153153
const result = KnowledgeBaseCreateFormSchema.safeParse(validBaseData);
154154

155155
if (!result.success) {
156-
console.error('Validation errors:', JSON.stringify(result.error.errors, null, 2));
156+
console.error('Validation errors:', JSON.stringify(result.error.issues, null, 2));
157157
}
158158

159159
expect(result.success).toBe(true);
@@ -167,7 +167,7 @@ describe('KnowledgeBaseCreateFormSchema', () => {
167167

168168
expect(result.success).toBe(false);
169169
if (!result.success) {
170-
const usernameError = result.error.errors.find((err) => err.path[0] === 'redpandaUsername');
170+
const usernameError = result.error.issues.find((err) => err.path[0] === 'redpandaUsername');
171171
expect(usernameError?.message).toContain('required');
172172
}
173173
});
@@ -180,7 +180,7 @@ describe('KnowledgeBaseCreateFormSchema', () => {
180180

181181
expect(result.success).toBe(false);
182182
if (!result.success) {
183-
const passwordError = result.error.errors.find((err) => err.path[0] === 'redpandaPassword');
183+
const passwordError = result.error.issues.find((err) => err.path[0] === 'redpandaPassword');
184184
expect(passwordError?.message).toContain('required');
185185
}
186186
});

0 commit comments

Comments
 (0)