Skip to content

Commit e6d8c11

Browse files
committed
add a test with confirm=false
1 parent 506d40f commit e6d8c11

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

internal/cli/streams/privatelink/delete_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,26 @@ func TestDeleteOpts_Run(t *testing.T) {
7272

7373
require.NoError(t, err)
7474
})
75+
76+
t.Run("should not call delete if confirm is false", func(t *testing.T) {
77+
ctrl := gomock.NewController(t)
78+
mockStore := mocks.NewMockPrivateLinkDeleter(ctrl)
79+
80+
deleteOpts := &DeleteOpts{
81+
DeleteOpts: &cli.DeleteOpts{
82+
Entry: "another-connection-id",
83+
Confirm: false,
84+
},
85+
store: mockStore,
86+
}
87+
88+
mockStore.
89+
EXPECT().
90+
DeletePrivateLinkEndpoint(gomock.Any(), gomock.Any()).
91+
Times(0)
92+
93+
err := deleteOpts.Run()
94+
95+
require.NoError(t, err)
96+
})
7597
}

0 commit comments

Comments
 (0)