Skip to content

Commit 2b14ca5

Browse files
committed
test: add end-to-end test for uploading from folder with date derived from file name
1 parent 2f2ebd6 commit 2b14ca5

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Binary file not shown.

internal/e2eTests/tests/fromfolder_test.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,39 @@ func TestFromFolders(t *testing.T) {
303303
fileevent.Tagged: 5,
304304
}, false, a.Jnl())
305305
})
306+
307+
t.Run("date-from-name", func(t *testing.T) {
308+
e2e.InitMyEnv()
309+
e2e.ResetImmich(t)
310+
311+
ctx := context.Background()
312+
c, a := cmd.RootImmichGoCommand(ctx)
313+
c.SetArgs([]string{
314+
"upload", "from-folder",
315+
"--server=" + e2e.MyEnv("IMMICHGO_SERVER"),
316+
"--api-key=" + e2e.MyEnv("IMMICHGO_APIKEY"),
317+
"--no-ui",
318+
"--api-trace",
319+
"--log-level=debug",
320+
"--tag=tag/subtag",
321+
"--into-album=album",
322+
"--date-from-name",
323+
"DATA/dates",
324+
})
325+
err := c.ExecuteContext(ctx)
326+
if err != nil && a.Log().GetSLog() != nil {
327+
a.Log().Error(err.Error())
328+
}
329+
330+
if err != nil {
331+
t.Error("Unexpected error", err)
332+
return
333+
}
334+
335+
e2e.CheckResults(t, map[fileevent.Code]int64{
336+
fileevent.Uploaded: int64(len(highJpgs)),
337+
fileevent.UploadAddToAlbum: int64(len(highJpgs)),
338+
fileevent.Tagged: int64(len(highJpgs)),
339+
}, false, a.Jnl())
340+
})
306341
}

0 commit comments

Comments
 (0)