Tests: Adapt tests for internal/query to fixture updates
This commit is contained in:
parent
4f10fdc83a
commit
8b47775315
4 changed files with 11 additions and 11 deletions
|
@ -34,7 +34,7 @@ func TestAlbumCoverByUID(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, "exampleFileName.jpg", file.FileName)
|
||||
assert.Equal(t, "2020/07/exampleFileName.jpg", file.FileName)
|
||||
})
|
||||
|
||||
t.Run("existing uid folder album", func(t *testing.T) {
|
||||
|
@ -44,7 +44,7 @@ func TestAlbumCoverByUID(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, "bridge2.jpg", file.FileName)
|
||||
assert.Equal(t, "London/bridge2.jpg", file.FileName)
|
||||
})
|
||||
|
||||
t.Run("existing uid empty moment album", func(t *testing.T) {
|
||||
|
|
|
@ -75,7 +75,7 @@ func TestFilesByUID(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 1, len(files))
|
||||
assert.Equal(t, "exampleFileName.jpg", files[0].FileName)
|
||||
assert.Equal(t, "2020/07/exampleFileName.jpg", files[0].FileName)
|
||||
})
|
||||
t.Run("no files found", func(t *testing.T) {
|
||||
files, err := FilesByUID([]string{"ft8es39w45bnlxxx"}, 100, 0)
|
||||
|
@ -100,7 +100,7 @@ func TestFileByPhotoUID(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, "bridge.jpg", file.FileName)
|
||||
assert.Equal(t, "London/bridge.jpg", file.FileName)
|
||||
})
|
||||
|
||||
t.Run("no files found", func(t *testing.T) {
|
||||
|
@ -118,7 +118,7 @@ func TestVideoByPhotoUID(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, "bridge.mp4", file.FileName)
|
||||
assert.Equal(t, "London/bridge2.mp4", file.FileName)
|
||||
})
|
||||
|
||||
t.Run("no files found", func(t *testing.T) {
|
||||
|
@ -137,7 +137,7 @@ func TestFileByUID(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, "exampleFileName.jpg", file.FileName)
|
||||
assert.Equal(t, "2020/07/exampleFileName.jpg", file.FileName)
|
||||
})
|
||||
|
||||
t.Run("no files found", func(t *testing.T) {
|
||||
|
@ -159,7 +159,7 @@ func TestFileByHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, "exampleFileName.jpg", file.FileName)
|
||||
assert.Equal(t, "2020/07/exampleFileName.jpg", file.FileName)
|
||||
})
|
||||
|
||||
t.Run("no files found", func(t *testing.T) {
|
||||
|
@ -248,7 +248,7 @@ func TestRenameFile(t *testing.T) {
|
|||
}
|
||||
})
|
||||
t.Run("success", func(t *testing.T) {
|
||||
assert.Equal(t, "exampleXmpFile.xmp", entity.FileFixturesExampleXMP.FileName)
|
||||
assert.Equal(t, "2020/07/exampleXmpFile.xmp", entity.FileFixturesExampleXMP.FileName)
|
||||
assert.Equal(t, "/", entity.FileFixturesExampleXMP.FileRoot)
|
||||
err := RenameFile("/", "exampleXmpFile.xmp", "test-root", "yyy.jpg")
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ func TestLabelThumbBySlug(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, "bridge2.jpg", file.FileName)
|
||||
assert.Equal(t, "London/bridge2.jpg", file.FileName)
|
||||
})
|
||||
|
||||
t.Run("no file found", func(t *testing.T) {
|
||||
|
@ -72,7 +72,7 @@ func TestLabelThumbByUID(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, "bridge2.jpg", file.FileName)
|
||||
assert.Equal(t, "London/bridge2.jpg", file.FileName)
|
||||
})
|
||||
|
||||
t.Run("no file found", func(t *testing.T) {
|
||||
|
|
|
@ -693,7 +693,7 @@ func TestPhotoSearch(t *testing.T) {
|
|||
frm.Count = 10
|
||||
frm.Offset = 0
|
||||
frm.Name = "xxx|PhotoWithEditedAt"
|
||||
frm.Filename = "xxx|Photo25.jpg"
|
||||
frm.Filename = "xxx|test/Photo25.jpg"
|
||||
frm.Original = "xxx|OriginalPhotoWithEditedAt"
|
||||
frm.Title = "xxx|photowitheditedatdate"
|
||||
frm.Hash = "xxx|pcad9a68fa6acc5c5ba965adf6ec465ca42fd887"
|
||||
|
|
Loading…
Reference in a new issue