Skip to content

Commit

Permalink
added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaangiolillo committed Jan 3, 2024
1 parent bbb4cc3 commit 39d45ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/cli/default_setter_opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,14 @@ func TestDefaultOpts_Orgs(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, expectedOrgs.Results, gotOrgs)
})

t.Run("with no org", func(t *testing.T) {
expectedOrgs := &atlas.Organizations{
Results: []*atlas.Organization{},
}
mockStore.EXPECT().Organizations(gomock.Any()).Return(expectedOrgs, nil).Times(1)
_, err := opts.orgs("")
require.Error(t, err)
require.EqualError(t, err, errNoResults.Error())
})
}

0 comments on commit 39d45ce

Please sign in to comment.