From 15badb382adb7f3d17b846967a258e0a15cf84d7 Mon Sep 17 00:00:00 2001 From: Tink bot Date: Tue, 19 May 2026 08:37:50 +0000 Subject: [PATCH] test(api): cover positive project-identifier resolution Adds back the by-identifier and case-insensitive-input cases now that project identifiers are stored uppercase across the codebase. --- pkg/webtests/task_by_index_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/webtests/task_by_index_test.go b/pkg/webtests/task_by_index_test.go index 3921d6170..387c9c9d9 100644 --- a/pkg/webtests/task_by_index_test.go +++ b/pkg/webtests/task_by_index_test.go @@ -50,6 +50,19 @@ func TestTaskByProjectIndex(t *testing.T) { assert.Contains(t, rec.Body.String(), `"id":1`) }) + t.Run("by project identifier", func(t *testing.T) { + // Project 1 has identifier "TEST1" in fixtures. + rec := do("/api/v1/projects/TEST1/tasks/by-index/1") + assert.Equal(t, http.StatusOK, rec.Code) + assert.Contains(t, rec.Body.String(), `"id":1`) + }) + + t.Run("identifier match is case-insensitive on the input", func(t *testing.T) { + rec := do("/api/v1/projects/test1/tasks/by-index/1") + assert.Equal(t, http.StatusOK, rec.Code) + assert.Contains(t, rec.Body.String(), `"id":1`) + }) + t.Run("unknown project identifier returns 404", func(t *testing.T) { rec := do("/api/v1/projects/does-not-exist/tasks/by-index/1") assert.Equal(t, http.StatusNotFound, rec.Code)