From 85262bd22f6ae6ea627b72a92a17594cb7814b4f Mon Sep 17 00:00:00 2001 From: kolsys Date: Fri, 12 Apr 2024 12:52:39 +0300 Subject: [PATCH] Fix tests --- cmd/slackdump/main_test.go | 5 +++-- export/export_test.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/slackdump/main_test.go b/cmd/slackdump/main_test.go index 8a3ec958..6f74ccc0 100644 --- a/cmd/slackdump/main_test.go +++ b/cmd/slackdump/main_test.go @@ -47,6 +47,7 @@ func Test_checkParameters(t *testing.T) { slackdump.DefOptions.CacheDir = app.CacheDir() // test + emptyEntityList, _ := structures.NewEntityList([]string{}) type args struct { args []string } @@ -72,7 +73,7 @@ func Test_checkParameters(t *testing.T) { }, FilenameTemplate: defFilenameTemplate, - Input: config.Input{List: &structures.EntityList{}}, + Input: config.Input{List: emptyEntityList}, Output: config.Output{Filename: "-", Format: "text"}, Options: slackdump.DefOptions, }}, @@ -93,7 +94,7 @@ func Test_checkParameters(t *testing.T) { Users: true, }, FilenameTemplate: defFilenameTemplate, - Input: config.Input{List: &structures.EntityList{}}, + Input: config.Input{List: emptyEntityList}, Output: config.Output{Filename: "-", Format: "text"}, Options: slackdump.DefOptions, }}, diff --git a/export/export_test.go b/export/export_test.go index e30d354f..31f5ea98 100644 --- a/export/export_test.go +++ b/export/export_test.go @@ -405,7 +405,8 @@ func TestExport_exportConversation(t *testing.T) { Return(tt.mocks.rets.closeErr) } } - if err := exp.exportConversation(context.Background(), testUserIdx, tt.args.ch); (err != nil) != tt.wantErr { + exportItem := &structures.EntityItem{Id: tt.args.ch.ID} + if err := exp.exportConversation(context.Background(), testUserIdx, tt.args.ch, exportItem); (err != nil) != tt.wantErr { t.Errorf("Export.exportConversation() error = %v, wantErr %v", err, tt.wantErr) } })