Skip to content

Commit 2887961

Browse files
committed
test: add axios-dependent tests for filesplugin icon loading and file actions
Cover the axios interaction paths in filesplugin.js that are most sensitive to axios version upgrades: custom validateStatus, responseType, response header inspection, and redirect handling. Export loadExAppInlineSvgIcon and registerFileAction33 for testability.
1 parent 8359d59 commit 2887961

2 files changed

Lines changed: 406 additions & 3 deletions

File tree

src/filesplugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function isSvgContentType(ct) {
2020
return (ct || '').toLowerCase().startsWith('image/svg+xml')
2121
}
2222

23-
function loadExAppInlineSvgIcon(appId, route) {
23+
export function loadExAppInlineSvgIcon(appId, route) {
2424
const url = generateAppAPIProxyUrl(appId, route)
2525
return axios.get(url, {
2626
responseType: 'text',
@@ -86,7 +86,7 @@ export function generateExAppUIPageUrl(appId, route) {
8686
return generateUrl(`/apps/app_api/embedded/${appId}/${route}`)
8787
}
8888

89-
function registerFileAction33(fileAction, iconProvider) {
89+
export function registerFileAction33(fileAction, iconProvider) {
9090
const handlerUrl = generateAppAPIProxyUrl(fileAction.appid, fileAction.action_handler)
9191
const isV2 = ('version' in fileAction && fileAction.version === '2.0')
9292

0 commit comments

Comments
 (0)