Update E2E tests

pull/7/head
Toni Melisma 3 years ago
parent 1066ef8a51
commit 8d2f4fae39
No known key found for this signature in database
GPG Key ID: FFF9A7EDDEA34756

@ -432,6 +432,7 @@ func hasDirectoryChanged(source directory, gallery directory, cleanUp bool, conf
}
}
// TODO recurse gallery simultaneously with source, nil if not available
if cleanUp {
for _, galleryFile := range gallery.files {
if !reservedFile(galleryFile.name, config) && !galleryFile.exists {

@ -58,6 +58,15 @@ func TestE2E(t *testing.T) {
originalFilename1 := filepath.Join(tempDir, "gallery", "subdir", "subsubdir", config.files.originalDir, "recorder.heic")
assert.FileExists(t, originalFilename1)
missingHTMLFiles := findMissingHTMLFiles(gallery, config)
assert.EqualValues(t, true, missingHTMLFiles)
// create HTML
updateHTMLFiles(0, source, gallery, false, true, config)
missingHTMLFiles = findMissingHTMLFiles(gallery, config)
assert.EqualValues(t, false, missingHTMLFiles)
// Make changes and re-test
sourceFilename1 := filepath.Join(tempDir, "source", "street.jpg")
err = os.Chtimes(sourceFilename1, time.Now().Local(), time.Now().Local())
@ -79,6 +88,8 @@ func TestE2E(t *testing.T) {
galleryChanges = countChanges(gallery, config)
assert.EqualValues(t, 3, galleryChanges)
// update without cleanup in gallery
updateMediaFiles(0, source, gallery, false, true, config, nil)
assert.FileExists(t, fullsizeFilename2)
@ -86,4 +97,10 @@ func TestE2E(t *testing.T) {
// cleanup gallery
cleanUp(gallery, false, config)
assert.NoFileExists(t, fullsizeFilename2)
// update HTML
updateHTMLFiles(0, source, gallery, false, true, config)
missingHTMLFiles = findMissingHTMLFiles(gallery, config)
assert.EqualValues(t, false, missingHTMLFiles)
}

Loading…
Cancel
Save