Skip to content

Commit

Permalink
feat(wip): defaults set
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassabreu committed Jun 5, 2024
1 parent d5e203a commit 33b6695
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/cmd/time-entry/defaults/set/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
},
Expand Down Expand Up @@ -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 != "" {
Expand All @@ -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)
Expand Down

0 comments on commit 33b6695

Please sign in to comment.