Merge branch '18946-user-profile' refs #18946
[arvados-workbench2.git] / src / services / collection-service / collection-service-files-response.test.ts
index b2480c4bd2429c12dc0b5de8a05fd95773bb4bdd..a043b7c68075e9cae5d0ad5b847e1ec051088f5c 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { CollectionFile } from '~/models/collection-file';
+import { CollectionFile } from 'models/collection-file';
 import { getFileFullPath, extractFilesData } from './collection-service-files-response';
 
 describe('collection-service-files-response', () => {
@@ -11,10 +11,10 @@ describe('collection-service-files-response', () => {
         it('should correctly decode URLs & file names', () => {
             const testCases = [
                 // input URL, input display name, expected URL, expected name
-                ['table%201%202%203', 'table 1 2 3', 'table 1 2 3', 'table 1 2 3'],
-                ['table%25&%3F%2A2', 'table%&?*2', 'table%&?*2', 'table%&?*2'],
-                ["G%C3%BCnter%27s%20file.pdf", "Günter's file.pdf", "Günter's file.pdf", "Günter's file.pdf"],
-                ['G%25C3%25BCnter%27s%2520file.pdf', 'G%C3%BCnter's%20file.pdf', "G%C3%BCnter's%20file.pdf", "G%C3%BCnter's%20file.pdf"]
+                ['table%201%202%203', 'table 1 2 3', 'table%201%202%203', 'table 1 2 3'],
+                ['table%25&%3F%2A2', 'table%&?*2', 'table%25&%3F%2A2', 'table%&?*2'],
+                ["G%C3%BCnter%27s%20file.pdf", "Günter's file.pdf", "G%C3%BCnter%27s%20file.pdf", "Günter's file.pdf"],
+                ['G%25C3%25BCnter%27s%2520file.pdf', 'G%C3%BCnter's%20file.pdf', "G%25C3%25BCnter%27s%2520file.pdf", "G%C3%BCnter's%20file.pdf"]
             ];
 
             testCases.forEach(([inputURL, inputDisplayName, expectedURL, expectedName]) => {
@@ -79,7 +79,7 @@ describe('collection-service-files-response', () => {
                 const result = extractFilesData(xmlDoc);
 
                 // then
-                expect(result).toEqual([{ id: `${collUUID}/${expectedURL}`, name: expectedName, path: "", size: 3, type: "file", url: `/c=${collUUID}/${expectedURL}` }]);
+                expect(result).toEqual([{ id: `${collUUID}/${expectedName}`, name: expectedName, path: "", size: 3, type: "file", url: `/c=${collUUID}/${expectedURL}` }]);
             });
         });
     });