From e5f3219c7e42fa822d3784e152a7024289ef266c Mon Sep 17 00:00:00 2001 From: Ariana Kataoka Date: Thu, 18 Jul 2024 21:49:57 +1000 Subject: [PATCH] Prettier --- __tests__/lib/vip-import-validate-files.js | 22 +++++++++++----------- src/lib/vip-import-validate-files.ts | 1 - 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/__tests__/lib/vip-import-validate-files.js b/__tests__/lib/vip-import-validate-files.js index 89ff2678f0..ac29d7caf1 100644 --- a/__tests__/lib/vip-import-validate-files.js +++ b/__tests__/lib/vip-import-validate-files.js @@ -2,7 +2,7 @@ import chalk from 'chalk'; import fs from 'fs'; import { - folderStructureValidation, + directoryStructureValidation, isFileSanitized, validateFiles, logErrors, @@ -12,9 +12,9 @@ import { global.console = { log: jest.fn(), error: jest.fn() }; describe( 'lib/vip-import-validate-files', () => { - describe( 'folderStructureValidation', () => { - it( 'should correctly validate a recommended folder structure', async () => { - const folderStructureObj = { + describe( 'directoryStructureValidation', () => { + it( 'should correctly validate a recommended directory structure', async () => { + const directoryStructureObj = { 'uploads/2020/06': true, 'uploads/2019/01': true, 'uploads/2018/03': true, @@ -24,20 +24,20 @@ describe( 'lib/vip-import-validate-files', () => { jest.spyOn( global.console, 'log' ); // Call function - folderStructureValidation( Object.keys( folderStructureObj ) ); + directoryStructureValidation( Object.keys( directoryStructureObj ) ); expect( console.log ).toHaveBeenCalled(); - expect( console.log.mock.calls[ 0 ][ 0 ] ).toEqual( expect.stringContaining( 'Folder:' ) ); + expect( console.log.mock.calls[ 0 ][ 0 ] ).toEqual( expect.stringContaining( 'Directory:' ) ); expect( console.log.mock.calls[ 0 ][ 1 ] ).toEqual( expect.stringContaining( 'uploads/2020/06' ) ); } ); - it( 'should log recommendations for a non-recommended folder structure', async () => { - const path = 'folder/structure/not-recommended'; + it( 'should log recommendations for a non-recommended directory structure', async () => { + const path = 'directory/structure/not-recommended'; jest.spyOn( global.console, 'log' ); - folderStructureValidation( path ); + directoryStructureValidation( path ); expect( console.log ).toHaveBeenCalled(); } ); @@ -257,7 +257,7 @@ describe( 'lib/vip-import-validate-files', () => { const result = findNestedDirectories( '/empty/dir' ); - expect( result ).toEqual( { files: [], folderStructureObj: {} } ); + expect( result ).toEqual( { files: [], directoryStructureObj: {} } ); } ); it( 'should filter out hidden files', () => { @@ -268,7 +268,7 @@ describe( 'lib/vip-import-validate-files', () => { expect( result ).toEqual( { files: [ '/dir/with/hidden/files/file1.txt', '/dir/with/hidden/files/file2.txt' ], - folderStructureObj: { '/dir/with/hidden/files': true }, + directoryStructureObj: { '/dir/with/hidden/files': true }, } ); } ); } ); diff --git a/src/lib/vip-import-validate-files.ts b/src/lib/vip-import-validate-files.ts index b038dd629c..21183c0371 100644 --- a/src/lib/vip-import-validate-files.ts +++ b/src/lib/vip-import-validate-files.ts @@ -601,7 +601,6 @@ const multiSiteValidation = ( directoryPath: string ): string | null => { return null; }; - /** * Directory structure validation *