Skip to content

Commit

Permalink
All empty string for entry.meanings[].categories
Browse files Browse the repository at this point in the history
  • Loading branch information
khshourov committed Nov 1, 2024
1 parent 9fb9dd8 commit df2baed
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,29 @@ describe('lexical-entry schema validate', () => {
},
},
],
[
{
name: 'hello',
entry: {
ipaListings: {
us: [
{
category: '',
ipa: '/heˈloʊ/',
audio:
'https://dictionary.cambridge.org/media/english/us_pron/h/hel/hello/hello.mp3',
},
],
},
meanings: [
{
categories: '', // categories can be empty
entries: [],
},
],
},
},
],
])('schema should accept all valid lexical-entries', (validObject) => {
expect(lexicalEntrySchema.isValidSync(validObject)).toBe(true);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const meaningEntrySchema = object({
});

export const meaningSchema = object({
categories: string().required(),
categories: string().nonNullable().defined(),
entries: array().of(meaningEntrySchema).required(),
});

Expand Down

0 comments on commit df2baed

Please sign in to comment.