Skip to content

Commit

Permalink
add a test with confirm=false
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrydberg committed Feb 19, 2025
1 parent 506d40f commit e6d8c11
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions internal/cli/streams/privatelink/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,26 @@ func TestDeleteOpts_Run(t *testing.T) {

require.NoError(t, err)
})

t.Run("should not call delete if confirm is false", func(t *testing.T) {
ctrl := gomock.NewController(t)
mockStore := mocks.NewMockPrivateLinkDeleter(ctrl)

deleteOpts := &DeleteOpts{
DeleteOpts: &cli.DeleteOpts{
Entry: "another-connection-id",
Confirm: false,
},
store: mockStore,
}

mockStore.
EXPECT().
DeletePrivateLinkEndpoint(gomock.Any(), gomock.Any()).
Times(0)

err := deleteOpts.Run()

require.NoError(t, err)
})
}

0 comments on commit e6d8c11

Please sign in to comment.