Skip to content

Commit

Permalink
Fix upload tests in new year
Browse files Browse the repository at this point in the history
I’m not sure why I included the year number in the file name in
f6e28b5 (probably to limit the number of file versions?), but this
made the tests fail in 2024: we expect warnings for the same content in
older versions of the same file, but not in other files. Add that.

    {"result":"Warning","warnings":{"duplicate":["M3api_test_file_2023.svg"]},"filekey":"...","sessionkey":"..."}
  • Loading branch information
lucaswerkmeister committed Jan 10, 2024
1 parent 2106817 commit a0700f1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/integration/node.test.js
Expand Up @@ -195,8 +195,16 @@ describe( 'NodeSession', function () {
continue;
}

delete warnings.exists;
delete warnings.duplicateversions;
// handle warnings about the same content already existing
delete warnings.exists; // file already exists
delete warnings.duplicateversions; // same content in old version of same file
if ( 'duplicate' in warnings ) {
// same content in file from earlier years?
if ( warnings.duplicate.every( ( name ) => name.startsWith( 'M3api_test_file_' ) ) ) {
delete warnings.duplicate;
}
}

if ( Object.keys( warnings ).length === 0 ) {
// ignore these specific warnings, repeat by file key
expect( upload ).to.have.property( 'filekey' );
Expand Down

0 comments on commit a0700f1

Please sign in to comment.