0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/test/utils
Simon Backx 42ac8c41e4
🐛 Fixed uppercase file extensions ignored in content import (#14268)
refs https://github.com/TryGhost/Team/issues/1363

- When uploading a zip of images in Settings > Labs > [Import], it will skip images that have an uppercase extension, citing an 'unsupported file type' error.
- Cause: Glob ignored those files when matching extensions in ImportManager
- Fix: Added nocase option where needed
- Extended tests to also test the processZip method of ImportManager with getFilesFromZip
- Added isValidZip for zip with uppercase image
- Cleaned up JSDoc in ImportManager, and replaced some older JS syntax

Fixed zipContainsMultipleDataFormats error never thrown:

When a zip combines two data formats, no error was thrown.

- The promise error was only returned in an _.each loop, but never thrown
- Previously when combining multiple data types in a zip file, no error got thrown
- Added a test for this error
- Also added a test for noContentToImport error

Other errors and fixes:

- Added missing length in getBaseDirectory check
- getContentTypes fixed (returned duplicate values). Type error came up after adding all JSDocs
- updated tests to match real types from JSDoc and pass type validations
- Rewrote some methods in the async await syntax
- Added tests for ImportManager clean up
2022-03-11 09:17:58 +01:00
..
fixtures 🐛 Fixed uppercase file extensions ignored in content import (#14268) 2022-03-11 09:17:58 +01:00
mocks Colocated mock-express style utilities 2021-10-20 13:18:35 +01:00
admin-api-test-agent.js Extracted TestAgent class for test utils 2022-02-21 11:19:07 +07:00
admin-utils.js Improved dev tooling (#13118) 2021-07-05 20:02:22 +01:00
api.js Fixed handing test suite 2021-12-09 13:52:02 +04:00
assertions.js
configUtils.js
content-api-test-agent.js Added ContentAPITestAgent 2022-02-23 17:08:56 +07:00
db-utils.js Restored quick database reset method via table truncation 2022-02-07 21:27:10 +01:00
e2e-framework-mock-manager.js Added disableStripe method to mock manager 2022-03-10 11:35:03 +00:00
e2e-framework.js Renamed e2e framework date matchers 2022-03-01 18:17:13 +07:00
e2e-utils.js Added settingsCache handling to e2e-framework 2022-02-11 16:24:24 +00:00
fixture-utils.js 🐛 Fixed welcome pages not working for "subscribe" links (#14176) 2022-02-20 16:02:42 +02:00
index.js Added extra debug to test utilities 2021-11-19 10:47:21 +00:00
members-api-test-agent.js Extracted TestAgent class for test utils 2022-02-21 11:19:07 +07:00
overrides.js Removed leftover @tryghost/jest-snapshot usage 2022-02-22 10:33:42 +07:00
redirects.js Split test utilities out into separate files 2021-02-16 20:17:04 +00:00
test-agent.js Removed @tryghost/jest-snapshot dependency 2022-02-22 09:41:58 +07:00
url-service-utils.js Removed unused parameter from isFinished method 2021-11-24 05:32:20 +13:00
urlUtils.js Updated test UrlUtils to use canary by default 2022-01-21 15:12:27 +00:00