diff --git a/internal/pkg/githubapi/github_test.go b/internal/pkg/githubapi/github_test.go index 68c9a041..881e92fb 100644 --- a/internal/pkg/githubapi/github_test.go +++ b/internal/pkg/githubapi/github_test.go @@ -438,72 +438,3 @@ func TestCommitStatusTargetURL(t *testing.T) { }) } } - -func Test_identifyCommonPaths(t *testing.T) { - t.Parallel() - type args struct { - promoPaths []string - targetPaths []string - } - tests := []struct { - name string - args args - want []string - }{ - { - name: "same paths", - args: args{ - promoPaths: []string{"path1/component/path", "path2/component/path", "path3/component/path"}, - targetPaths: []string{"path1", "path2", "path3"}, - }, - want: []string{"path1", "path2", "path3"}, - }, - { - name: "paths1 is empty", - args: args{ - promoPaths: []string{}, - targetPaths: []string{"path1", "path2", "path3"}, - }, - want: nil, - }, - { - name: "paths2 is empty", - args: args{ - promoPaths: []string{"path1/component/some", "path2/some/other", "path3"}, - targetPaths: []string{}, - }, - want: nil, - }, - { - name: "paths2 missing elements", - args: args{ - promoPaths: []string{"path1", "path2", "path3"}, - targetPaths: []string{""}, - }, - want: nil, - }, - { - name: "path1 missing elements", - args: args{ - promoPaths: []string{""}, - targetPaths: []string{"path1", "path2"}, - }, - want: nil, - }, - { - name: "path1 and path2 common elements", - args: args{ - promoPaths: []string{"path1/component/path", "path3/component/also"}, - targetPaths: []string{"path1", "path2", "path3"}, - }, - want: []string{"path1", "path3"}, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - got := uniqueCommonPaths(tt.args.promoPaths, tt.args.targetPaths) - assert.Equal(t, got, tt.want) - }) - } -}