Skip to content

Commit

Permalink
add buildfilter test
Browse files Browse the repository at this point in the history
  • Loading branch information
piksel committed Oct 14, 2023
1 parent f309ad4 commit ba2df7d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/filters/filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,21 @@ func TestFilterByNoneScope(t *testing.T) {
container.AssertExpectations(t)
}

func TestTestBuildFilterNoneScope(t *testing.T) {
filter, desc := BuildFilter(nil, nil, false, "none")

assert.Contains(t, desc, "without a scope")

scoped := new(mocks.FilterableContainer)
scoped.On("Scope").Return("anyscope", true)

unscoped := new(mocks.FilterableContainer)
unscoped.On("Scope").Return("", false)

assert.False(t, filter(scoped))
assert.True(t, filter(unscoped))
}

func TestFilterByDisabledLabel(t *testing.T) {
filter := FilterByDisabledLabel(NoFilter)
assert.NotNil(t, filter)
Expand Down

0 comments on commit ba2df7d

Please sign in to comment.