From 7e4cbc2a21aa9956ed8a6e92db79c49b73595bc7 Mon Sep 17 00:00:00 2001 From: Claire Saba Date: Wed, 14 Feb 2024 11:44:22 +0100 Subject: [PATCH] test(description): update tests on descriptions --- src/test/description.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/description.test.ts b/src/test/description.test.ts index f332c68..1316e77 100644 --- a/src/test/description.test.ts +++ b/src/test/description.test.ts @@ -39,8 +39,8 @@ describe('Full schema', () => { expect(french).toMatch(frenchDescription) }) test('Render schema', () => { - const englishSchema = renderJsonSchema(fullSchema, 'en') - const frenchSchema = renderJsonSchema(fullSchema, 'fr') + const englishSchema = renderJsonSchema('en', fullSchema) + const frenchSchema = renderJsonSchema('fr', fullSchema) expect(englishSchema).toMatchObject({ description: englishDescription }) expect(frenchSchema).toMatchObject({ description: frenchDescription }) }) @@ -54,8 +54,8 @@ describe('Schema without description', () => { expect(french).toMatch(frenchDescription) }) test('Render schema', () => { - const englishSchema = renderJsonSchema(schemaWithoutDescription, 'en') - const frenchSchema = renderJsonSchema(schemaWithoutDescription, 'fr') + const englishSchema = renderJsonSchema('en', schemaWithoutDescription) + const frenchSchema = renderJsonSchema('fr', schemaWithoutDescription) expect(englishSchema).toMatchObject({ description: englishDescription }) expect(frenchSchema).toMatchObject({ description: frenchDescription }) }) @@ -69,8 +69,8 @@ describe('Schema without descriptions', () => { expect(french).toMatch(description) }) test('Render schema', () => { - const englishSchema = renderJsonSchema(schemaWithoutDescriptions, 'en') - const frenchSchema = renderJsonSchema(schemaWithoutDescriptions, 'fr') + const englishSchema = renderJsonSchema('en', schemaWithoutDescriptions) + const frenchSchema = renderJsonSchema('fr', schemaWithoutDescriptions) expect(englishSchema).toMatchObject({ description }) expect(frenchSchema).toMatchObject({ description }) }) @@ -84,8 +84,8 @@ describe('Nested schemas', () => { expect(french).toMatch(frenchDescription) }) test('Render schema', () => { - const englishSchema = renderJsonSchema(nestedSchemas, 'en') - const frenchSchema = renderJsonSchema(nestedSchemas, 'fr') + const englishSchema = renderJsonSchema('en', nestedSchemas) + const frenchSchema = renderJsonSchema('fr', nestedSchemas) expect(englishSchema).toMatchObject({ description: englishDescription, items: [{ description: englishDescription }, { description: englishDescription }],