From 23366995f012d5c02cce889ef0b9ce0de5ef2df6 Mon Sep 17 00:00:00 2001 From: Luis Fernando Planella Gonzalez Date: Mon, 9 Oct 2023 08:35:18 -0300 Subject: [PATCH] Added a test for duplicated ids. This was actually already fixed with a previous issue. Closes #286 --- test/all-operations.json | 18 ++++++++++++++++++ test/all-operations.spec.ts | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/test/all-operations.json b/test/all-operations.json index 2ffac5f..eb36cd6 100644 --- a/test/all-operations.json +++ b/test/all-operations.json @@ -398,6 +398,24 @@ "204": {} } } + }, + "/duplicated1": { + "get": { + "operationId": "duplicated", + "summary": "Test a duplicated operationId", + "responses": { + "200": {} + } + } + }, + "/duplicated2": { + "get": { + "operationId": "duplicated", + "summary": "Test a duplicated operationId", + "responses": { + "200": {} + } + } } }, "components": { diff --git a/test/all-operations.spec.ts b/test/all-operations.spec.ts index efc4328..a3bb5cf 100644 --- a/test/all-operations.spec.ts +++ b/test/all-operations.spec.ts @@ -115,7 +115,7 @@ describe('Generation tests using all-operations.json', () => { const noTag = gen.services.get('noTag'); expect(noTag).toBeDefined(); if (!noTag) return; - expect(noTag.operations.length).toBe(5); + expect(noTag.operations.length).toBe(7); const ts = gen.templates.apply('service', noTag); const parser = new TypescriptParser();