Skip to content

Commit

Permalink
Remove old test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvarts committed Oct 28, 2024
1 parent 50e4e8d commit 834f7e4
Showing 1 changed file with 0 additions and 69 deletions.
69 changes: 0 additions & 69 deletions internal/pkg/githubapi/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
}

0 comments on commit 834f7e4

Please sign in to comment.