also ran the formatter on the e2e folder :)

This commit is contained in:
Robin Jacobs 2025-10-14 16:10:45 +01:00
parent c89449081c
commit e1351c570a

View file

@ -444,10 +444,11 @@ describe(`immich upload`, () => {
describe('immich upload --delete-duplicates', () => { describe('immich upload --delete-duplicates', () => {
it('should delete local duplicate files', async () => { it('should delete local duplicate files', async () => {
const { stderr: firstStderr, stdout: firstStdout, exitCode: firstExitCode } = await immichCli([ const {
'upload', stderr: firstStderr,
`${testAssetDir}/albums/nature/silver_fir.jpg`, stdout: firstStdout,
]); exitCode: firstExitCode,
} = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]);
expect(firstStderr).toContain('{message}'); expect(firstStderr).toContain('{message}');
expect(firstStdout.split('\n')).toEqual( expect(firstStdout.split('\n')).toEqual(
expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]),
@ -484,10 +485,11 @@ describe(`immich upload`, () => {
}); });
it('should have accurate dry run with --delete-duplicates', async () => { it('should have accurate dry run with --delete-duplicates', async () => {
const { stderr: firstStderr, stdout: firstStdout, exitCode: firstExitCode } = await immichCli([ const {
'upload', stderr: firstStderr,
`${testAssetDir}/albums/nature/silver_fir.jpg`, stdout: firstStdout,
]); exitCode: firstExitCode,
} = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]);
expect(firstStderr).toContain('{message}'); expect(firstStderr).toContain('{message}');
expect(firstStdout.split('\n')).toEqual( expect(firstStdout.split('\n')).toEqual(
expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]),
@ -526,10 +528,11 @@ describe(`immich upload`, () => {
it('should work with both --delete and --delete-duplicates flags', async () => { it('should work with both --delete and --delete-duplicates flags', async () => {
// First, upload a file to create a duplicate on the server // First, upload a file to create a duplicate on the server
const { stderr: firstStderr, stdout: firstStdout, exitCode: firstExitCode } = await immichCli([ const {
'upload', stderr: firstStderr,
`${testAssetDir}/albums/nature/silver_fir.jpg`, stdout: firstStdout,
]); exitCode: firstExitCode,
} = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]);
expect(firstStderr).toContain('{message}'); expect(firstStderr).toContain('{message}');
expect(firstStdout.split('\n')).toEqual( expect(firstStdout.split('\n')).toEqual(
expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]),
@ -570,10 +573,11 @@ describe(`immich upload`, () => {
}); });
it('should only delete duplicates when --delete-duplicates is used without --delete', async () => { it('should only delete duplicates when --delete-duplicates is used without --delete', async () => {
const { stderr: firstStderr, stdout: firstStdout, exitCode: firstExitCode } = await immichCli([ const {
'upload', stderr: firstStderr,
`${testAssetDir}/albums/nature/silver_fir.jpg`, stdout: firstStdout,
]); exitCode: firstExitCode,
} = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]);
expect(firstStderr).toContain('{message}'); expect(firstStderr).toContain('{message}');
expect(firstStdout.split('\n')).toEqual( expect(firstStdout.split('\n')).toEqual(
expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]),
@ -586,11 +590,7 @@ describe(`immich upload`, () => {
await symlink(`${testAssetDir}/albums/nature/el_torcal_rocks.jpg`, `/tmp/albums/nature/el_torcal_rocks.jpg`); // new await symlink(`${testAssetDir}/albums/nature/el_torcal_rocks.jpg`, `/tmp/albums/nature/el_torcal_rocks.jpg`); // new
// Upload with only --delete-duplicates flag // Upload with only --delete-duplicates flag
const { stderr, stdout, exitCode } = await immichCli([ const { stderr, stdout, exitCode } = await immichCli(['upload', `/tmp/albums/nature`, '--delete-duplicates']);
'upload',
`/tmp/albums/nature`,
'--delete-duplicates',
]);
// Check that only the duplicate was deleted, new file should remain // Check that only the duplicate was deleted, new file should remain
const files = await readdir(`/tmp/albums/nature`); const files = await readdir(`/tmp/albums/nature`);