From 37e1b810ff73e093af79433eff80221cfd9fb853 Mon Sep 17 00:00:00 2001 From: Lucas dos Santos Abreu Date: Thu, 30 May 2024 19:05:42 -0300 Subject: [PATCH] feat(wip): defaults set --- pkg/cmd/time-entry/defaults/set/set_test.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/time-entry/defaults/set/set_test.go b/pkg/cmd/time-entry/defaults/set/set_test.go index 8f720963..d118ae37 100644 --- a/pkg/cmd/time-entry/defaults/set/set_test.go +++ b/pkg/cmd/time-entry/defaults/set/set_test.go @@ -515,6 +515,9 @@ func TestNewCmdSet_ShouldFail_WhenInvalidArgs(t *testing.T) { f.EXPECT().GetWorkspaceID().Return("w", nil) + f.EXPECT().Client(). + Return(mocks.NewMockClient(t), nil) + return f }, }, @@ -622,16 +625,21 @@ func TestNewCmdSet_ShouldUpdateDefaultsFile_OnlyByFlags(t *testing.T) { for i := range tts { tt := &tts[i] t.Run(tt.name, func(t *testing.T) { + f := mocks.NewMockFactory(t) + c := mocks.NewMockClient(t) + f.EXPECT().Client(). + Return(c, nil) + + f.EXPECT().Config().Return(&mocks.SimpleConfig{}) + if len(tt.args) != 0 { f.EXPECT().Config().Return(&mocks.SimpleConfig{ AllowNameForID: false, Interactive: false, }) - c := mocks.NewMockClient(t) - tasks := make([]dto.Task, 0) if tt.expected.TaskID != "" { @@ -656,8 +664,6 @@ func TestNewCmdSet_ShouldUpdateDefaultsFile_OnlyByFlags(t *testing.T) { c.On("GetTags", mock.Anything).Return(tags, nil) } - - f.EXPECT().Client().Return(c, nil) } f.EXPECT().GetWorkspaceID().Return(tt.expected.Workspace, nil)