From f872ace168ca7e1007eb78852d470bc671fc1cc1 Mon Sep 17 00:00:00 2001 From: Ramil Amparo Date: Tue, 21 Jul 2026 15:42:17 +0400 Subject: [PATCH 1/3] fix: never send empty tag names from --tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --tags "" sent [""] to the API, creating a tag with an empty title (Hypersequent/tms-issues#2668). Tag names are now trimmed and empty entries dropped, so --tags "" sends an empty array — a no-op on create, and clears all tags on update. Co-Authored-By: Claude Fable 5 --- src/commands/api/manifests/test-cases.ts | 7 +++- src/tests/api/test-cases/create.spec.ts | 48 ++++++++++++++++++++++++ src/tests/api/test-cases/update.spec.ts | 17 +++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/src/commands/api/manifests/test-cases.ts b/src/commands/api/manifests/test-cases.ts index 3031332..3ddf9f4 100644 --- a/src/commands/api/manifests/test-cases.ts +++ b/src/commands/api/manifests/test-cases.ts @@ -33,7 +33,7 @@ const help = { 'precondition-text': 'Precondition text (supports HTML). Mutually exclusive with --precondition-id.', 'precondition-id': 'Shared precondition ID. Mutually exclusive with --precondition-text.', - tags: 'Comma-separated tag names (e.g., "smoke,regression").', + tags: 'Comma-separated tag names (e.g., "smoke,regression"). On update, --tags "" clears all tags.', 'is-draft': 'Whether the test case is a draft.', draft: 'Filter by draft status (true or false).', steps: @@ -223,7 +223,10 @@ function transformTCaseFields(fields: Record): Record tag.trim()) + .filter((tag) => !!tag) } return result diff --git a/src/tests/api/test-cases/create.spec.ts b/src/tests/api/test-cases/create.spec.ts index 3cb2787..30867f6 100644 --- a/src/tests/api/test-cases/create.spec.ts +++ b/src/tests/api/test-cases/create.spec.ts @@ -378,6 +378,54 @@ describe('mocked', () => { steps: [{ description: 'Step 1', expected: 'Result 1' }], }) }) + + test('--tags "" sends an empty tags array', async ({ project }) => { + await runCommand( + '--project-code', + project.code, + '--title', + 'No tags', + '--type', + 'standalone', + '--folder-id', + '1', + '--priority', + 'medium', + '--tags', + '' + ) + expect(lastRequest).toEqual({ + title: 'No tags', + type: 'standalone', + folderId: 1, + priority: 'medium', + tags: [], + }) + }) + + test('trims tag names and drops empty ones', async ({ project }) => { + await runCommand( + '--project-code', + project.code, + '--title', + 'Messy tags', + '--type', + 'standalone', + '--folder-id', + '1', + '--priority', + 'medium', + '--tags', + ' smoke , ,regression, ' + ) + expect(lastRequest).toEqual({ + title: 'Messy tags', + type: 'standalone', + folderId: 1, + priority: 'medium', + tags: ['smoke', 'regression'], + }) + }) }) test('creates a test case on live server', { tags: ['live'] }, async ({ project }) => { diff --git a/src/tests/api/test-cases/update.spec.ts b/src/tests/api/test-cases/update.spec.ts index e40af89..f9db2c8 100644 --- a/src/tests/api/test-cases/update.spec.ts +++ b/src/tests/api/test-cases/update.spec.ts @@ -151,6 +151,23 @@ describe('mocked', () => { }) }) + test('--tags "" clears tags by sending an empty array', async ({ project }) => { + await runCommand('--project-code', project.code, '--tcase-id', 'tc1', '--tags', '') + expect(lastRequest).toEqual({ tags: [] }) + }) + + test('trims tag names and drops empty ones', async ({ project }) => { + await runCommand( + '--project-code', + project.code, + '--tcase-id', + 'tc1', + '--tags', + ' smoke , ,e2e ' + ) + expect(lastRequest).toEqual({ tags: ['smoke', 'e2e'] }) + }) + test('updates a test case with custom fields', async ({ project }) => { const body = { customFields: { From 34345772564771198a1e861ce7f86079ae34cabd Mon Sep 17 00:00:00 2001 From: Ramil Amparo Date: Tue, 21 Jul 2026 16:19:26 +0400 Subject: [PATCH 2/3] chore: bump version to 0.11.0 Co-Authored-By: Claude Fable 5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 79c5132..adc0758 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qas-cli", - "version": "0.10.0", + "version": "0.11.0", "description": "QAS CLI is a command line tool for submitting your automation test results to QA Sphere at https://qasphere.com/", "type": "module", "packageManager": "pnpm@11.1.2", From 890702dfe427caf41067fb26b4688501ea5ba0f1 Mon Sep 17 00:00:00 2001 From: Ramil Amparo Date: Tue, 21 Jul 2026 16:21:17 +0400 Subject: [PATCH 3/3] Bump patch version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index adc0758..b163797 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qas-cli", - "version": "0.11.0", + "version": "0.10.1", "description": "QAS CLI is a command line tool for submitting your automation test results to QA Sphere at https://qasphere.com/", "type": "module", "packageManager": "pnpm@11.1.2",