@theia/plugin-ext 1.75.0-next.3 → 1.75.0-next.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/errors.d.ts +1 -14
- package/lib/common/errors.d.ts.map +1 -1
- package/lib/common/errors.js +3 -16
- package/lib/common/errors.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +1 -1
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-protocol.d.ts +53 -648
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js +11 -34
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +2 -1
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +8 -3
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.d.ts.map +1 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.js +5 -36
- package/lib/hosted/browser/worker/plugin-manifest-loader.js.map +1 -1
- package/lib/hosted/browser/worker/worker-main.js +2 -1
- package/lib/hosted/browser/worker/worker-main.js.map +1 -1
- package/lib/hosted/common/hosted-plugin.js +10 -9
- package/lib/hosted/common/hosted-plugin.js.map +1 -1
- package/lib/hosted/common/hosted-plugin.spec.js +2 -0
- package/lib/hosted/common/hosted-plugin.spec.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js +4 -68
- package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.js +1 -0
- package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
- package/lib/hosted/node/hosted-plugin.js +1 -0
- package/lib/hosted/node/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/plugin-host-rpc.d.ts.map +1 -1
- package/lib/hosted/node/plugin-host-rpc.js +2 -2
- package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
- package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
- package/lib/hosted/node/plugin-reader.js +6 -4
- package/lib/hosted/node/plugin-reader.js.map +1 -1
- package/lib/hosted/node/plugin-service.js +1 -0
- package/lib/hosted/node/plugin-service.js.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.d.ts +3 -2
- package/lib/hosted/node/scanners/grammars-reader.d.ts.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.js +5 -23
- package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts +38 -71
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +117 -768
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.spec.js +191 -0
- package/lib/hosted/node/scanners/scanner-theia.spec.js.map +1 -1
- package/lib/main/browser/comments/comments-service.d.ts +2 -0
- package/lib/main/browser/comments/comments-service.d.ts.map +1 -1
- package/lib/main/browser/comments/comments-service.js +7 -1
- package/lib/main/browser/comments/comments-service.js.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +2 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +6 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.d.ts +2 -0
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js +7 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.d.ts +2 -1
- package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.js +9 -4
- package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +1 -1
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-icon-service.d.ts.map +1 -1
- package/lib/main/browser/plugin-icon-service.js +2 -1
- package/lib/main/browser/plugin-icon-service.js.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.js +2 -1
- package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
- package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
- package/lib/main/browser/plugin-shared-style.js +2 -1
- package/lib/main/browser/plugin-shared-style.js.map +1 -1
- package/lib/main/browser/scm-main.d.ts.map +1 -1
- package/lib/main/browser/scm-main.js +3 -1
- package/lib/main/browser/scm-main.js.map +1 -1
- package/lib/main/browser/text-editor-model-service.d.ts +2 -1
- package/lib/main/browser/text-editor-model-service.d.ts.map +1 -1
- package/lib/main/browser/text-editor-model-service.js +6 -1
- package/lib/main/browser/text-editor-model-service.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts +2 -0
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +14 -9
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +3 -0
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +17 -6
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +4 -2
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.js +3 -2
- package/lib/main/browser/webview-views/webview-views-main.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +2 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.js +10 -4
- package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +2 -0
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.js +9 -3
- package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
- package/lib/main/node/paths/plugin-paths-service.js +1 -0
- package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
- package/lib/main/node/plugin-deployer-contribution.js +1 -0
- package/lib/main/node/plugin-deployer-contribution.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +16 -13
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/main/node/plugin-service.d.ts +2 -0
- package/lib/main/node/plugin-service.d.ts.map +1 -1
- package/lib/main/node/plugin-service.js +7 -1
- package/lib/main/node/plugin-service.js.map +1 -1
- package/lib/main/node/plugin-uninstallation-manager.d.ts +2 -1
- package/lib/main/node/plugin-uninstallation-manager.d.ts.map +1 -1
- package/lib/main/node/plugin-uninstallation-manager.js +6 -1
- package/lib/main/node/plugin-uninstallation-manager.js.map +1 -1
- package/lib/main/node/plugins-key-value-storage.d.ts +2 -0
- package/lib/main/node/plugins-key-value-storage.d.ts.map +1 -1
- package/lib/main/node/plugins-key-value-storage.js +9 -3
- package/lib/main/node/plugins-key-value-storage.js.map +1 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.d.ts +2 -0
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.d.ts.map +1 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js +7 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js.map +1 -1
- package/lib/main/node/webview-backend-security-warnings.d.ts +2 -0
- package/lib/main/node/webview-backend-security-warnings.d.ts.map +1 -1
- package/lib/main/node/webview-backend-security-warnings.js +7 -1
- package/lib/main/node/webview-backend-security-warnings.js.map +1 -1
- package/lib/plugin/scm.js +1 -1
- package/lib/plugin/scm.js.map +1 -1
- package/package.json +31 -30
- package/src/common/errors.ts +1 -25
- package/src/common/plugin-api-rpc.ts +1 -1
- package/src/common/plugin-protocol.ts +203 -662
- package/src/hosted/browser/hosted-plugin.ts +8 -5
- package/src/hosted/browser/worker/plugin-manifest-loader.ts +8 -41
- package/src/hosted/browser/worker/worker-main.ts +2 -1
- package/src/hosted/common/hosted-plugin.spec.ts +2 -0
- package/src/hosted/common/hosted-plugin.ts +10 -10
- package/src/hosted/node/hosted-plugin-localization-service.ts +3 -82
- package/src/hosted/node/hosted-plugin-process.ts +1 -1
- package/src/hosted/node/hosted-plugin.ts +2 -2
- package/src/hosted/node/plugin-host-rpc.ts +3 -3
- package/src/hosted/node/plugin-reader.ts +7 -6
- package/src/hosted/node/plugin-service.ts +1 -1
- package/src/hosted/node/scanners/grammars-reader.ts +14 -23
- package/src/hosted/node/scanners/scanner-theia.spec.ts +225 -1
- package/src/hosted/node/scanners/scanner-theia.ts +204 -881
- package/src/main/browser/comments/comments-service.ts +6 -2
- package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +6 -3
- package/src/main/browser/debug/plugin-debug-session-contribution-registry.ts +5 -1
- package/src/main/browser/menus/menus-contribution-handler.ts +9 -6
- package/src/main/browser/plugin-contribution-handler.ts +1 -1
- package/src/main/browser/plugin-icon-service.ts +2 -1
- package/src/main/browser/plugin-icon-theme-service.ts +2 -1
- package/src/main/browser/plugin-shared-style.ts +2 -1
- package/src/main/browser/scm-main.ts +3 -1
- package/src/main/browser/text-editor-model-service.ts +6 -3
- package/src/main/browser/view/plugin-view-registry.ts +14 -11
- package/src/main/browser/view/tree-view-widget.tsx +14 -7
- package/src/main/browser/webview/webview.ts +4 -2
- package/src/main/browser/webview-views/webview-views-main.ts +4 -4
- package/src/main/node/handlers/plugin-theia-directory-handler.ts +9 -6
- package/src/main/node/handlers/plugin-theia-file-handler.ts +8 -5
- package/src/main/node/paths/plugin-paths-service.ts +2 -2
- package/src/main/node/plugin-deployer-contribution.ts +2 -2
- package/src/main/node/plugin-deployer-impl.ts +20 -14
- package/src/main/node/plugin-service.ts +6 -2
- package/src/main/node/plugin-uninstallation-manager.ts +7 -4
- package/src/main/node/plugins-key-value-storage.ts +8 -4
- package/src/main/node/resolvers/local-plugin-deployer-resolver.ts +7 -2
- package/src/main/node/webview-backend-security-warnings.ts +6 -2
- package/src/plugin/scm.ts +1 -1
- package/lib/hosted/node/plugin-activation-events.d.ts +0 -7
- package/lib/hosted/node/plugin-activation-events.d.ts.map +0 -1
- package/lib/hosted/node/plugin-activation-events.js +0 -95
- package/lib/hosted/node/plugin-activation-events.js.map +0 -1
- package/lib/hosted/node/plugin-manifest-loader.d.ts +0 -3
- package/lib/hosted/node/plugin-manifest-loader.d.ts.map +0 -1
- package/lib/hosted/node/plugin-manifest-loader.js +0 -34
- package/lib/hosted/node/plugin-manifest-loader.js.map +0 -1
- package/lib/main/node/errors.spec.d.ts +0 -2
- package/lib/main/node/errors.spec.d.ts.map +0 -1
- package/lib/main/node/errors.spec.js +0 -36
- package/lib/main/node/errors.spec.js.map +0 -1
- package/src/hosted/node/plugin-activation-events.ts +0 -112
- package/src/hosted/node/plugin-manifest-loader.ts +0 -32
- package/src/main/node/errors.spec.ts +0 -37
|
@@ -21,7 +21,7 @@ import * as os from 'os';
|
|
|
21
21
|
import * as path from 'path';
|
|
22
22
|
import * as fs from 'fs';
|
|
23
23
|
import { AbstractPluginScanner, TheiaPluginScanner } from './scanner-theia';
|
|
24
|
-
import { PluginPackage, PluginEntryPoint } from '../../../common/plugin-protocol';
|
|
24
|
+
import { PluginPackage, PluginEntryPoint, PluginPackageWalkthrough, WalkthroughContribution } from '../../../common/plugin-protocol';
|
|
25
25
|
import { PreferenceSchema } from '@theia/core/lib/common/preferences/preference-schema';
|
|
26
26
|
import URI from '@theia/core/lib/common/uri';
|
|
27
27
|
|
|
@@ -206,3 +206,227 @@ describe('TheiaPluginScanner configuration default derivation', () => {
|
|
|
206
206
|
expect(props['ext.nullable'].default).to.equal(null);
|
|
207
207
|
});
|
|
208
208
|
});
|
|
209
|
+
|
|
210
|
+
describe('TheiaPluginScanner - readWalkthroughs', () => {
|
|
211
|
+
let scannerInstance: TheiaPluginScanner;
|
|
212
|
+
|
|
213
|
+
before(() => {
|
|
214
|
+
scannerInstance = new (TheiaPluginScanner as any)();
|
|
215
|
+
(scannerInstance as any).logger = { error: () => { }, warn: () => { }, info: () => { }, debug: () => { } };
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
function callReadWalkthroughs(
|
|
219
|
+
walkthroughs: PluginPackageWalkthrough[],
|
|
220
|
+
publisher = 'test-publisher',
|
|
221
|
+
name = 'test-plugin',
|
|
222
|
+
icon?: string
|
|
223
|
+
): WalkthroughContribution[] | undefined {
|
|
224
|
+
const pkg = {
|
|
225
|
+
name,
|
|
226
|
+
publisher,
|
|
227
|
+
version: '1.0.0',
|
|
228
|
+
icon,
|
|
229
|
+
contributes: { walkthroughs }
|
|
230
|
+
} as any;
|
|
231
|
+
return (scannerInstance as any).readWalkthroughs(pkg);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
it('should resolve the icon of the contributing extension', () => {
|
|
235
|
+
const result = callReadWalkthroughs([{
|
|
236
|
+
id: 'wt1',
|
|
237
|
+
title: 'WT',
|
|
238
|
+
description: 'desc',
|
|
239
|
+
steps: [{ id: 's1', title: 'S1', description: 'd1' }]
|
|
240
|
+
}], 'test-publisher', 'test-plugin', 'images/icon.png');
|
|
241
|
+
|
|
242
|
+
expect(result![0].pluginIcon).to.equal('hostedPlugin/test_publisher_test_plugin/images/icon.png');
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('should leave the extension icon undefined when the package declares none', () => {
|
|
246
|
+
const result = callReadWalkthroughs([{
|
|
247
|
+
id: 'wt1',
|
|
248
|
+
title: 'WT',
|
|
249
|
+
description: 'desc',
|
|
250
|
+
steps: [{ id: 's1', title: 'S1', description: 'd1' }]
|
|
251
|
+
}]);
|
|
252
|
+
|
|
253
|
+
expect(result![0].pluginIcon).to.be.undefined;
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('should read a valid walkthrough contribution', () => {
|
|
257
|
+
const result = callReadWalkthroughs([{
|
|
258
|
+
id: 'my-walkthrough',
|
|
259
|
+
title: 'My Walkthrough',
|
|
260
|
+
description: 'A test walkthrough',
|
|
261
|
+
steps: [{
|
|
262
|
+
id: 'step1',
|
|
263
|
+
title: 'Step 1',
|
|
264
|
+
description: 'First step',
|
|
265
|
+
completionEvents: ['onCommand:my.command']
|
|
266
|
+
}]
|
|
267
|
+
}]);
|
|
268
|
+
|
|
269
|
+
expect(result).to.not.be.undefined;
|
|
270
|
+
expect(result).to.have.lengthOf(1);
|
|
271
|
+
expect(result![0].id).to.equal('my-walkthrough');
|
|
272
|
+
expect(result![0].title).to.equal('My Walkthrough');
|
|
273
|
+
expect(result![0].pluginId).to.equal('test-publisher.test-plugin');
|
|
274
|
+
expect(result![0].steps).to.have.lengthOf(1);
|
|
275
|
+
expect(result![0].steps[0].id).to.equal('step1');
|
|
276
|
+
expect(result![0].steps[0].completionEvents).to.deep.equal(['onCommand:my.command']);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
it('should skip walkthroughs with missing id', () => {
|
|
280
|
+
const result = callReadWalkthroughs([{
|
|
281
|
+
id: '',
|
|
282
|
+
title: 'No ID Walkthrough',
|
|
283
|
+
description: 'Missing id',
|
|
284
|
+
steps: []
|
|
285
|
+
}]);
|
|
286
|
+
|
|
287
|
+
expect(result).to.be.undefined;
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it('should skip walkthroughs with missing title', () => {
|
|
291
|
+
const result = callReadWalkthroughs([{
|
|
292
|
+
id: 'valid-id',
|
|
293
|
+
title: '',
|
|
294
|
+
description: 'Missing title',
|
|
295
|
+
steps: []
|
|
296
|
+
}]);
|
|
297
|
+
|
|
298
|
+
expect(result).to.be.undefined;
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
it('should skip walkthrough steps with missing id', () => {
|
|
302
|
+
const result = callReadWalkthroughs([{
|
|
303
|
+
id: 'wt1',
|
|
304
|
+
title: 'WT1',
|
|
305
|
+
description: 'desc',
|
|
306
|
+
steps: [
|
|
307
|
+
{ id: '', title: 'Step', description: 'desc' },
|
|
308
|
+
{ id: 'valid-step', title: 'Valid Step', description: 'desc' }
|
|
309
|
+
]
|
|
310
|
+
}]);
|
|
311
|
+
|
|
312
|
+
expect(result).to.have.lengthOf(1);
|
|
313
|
+
expect(result![0].steps).to.have.lengthOf(1);
|
|
314
|
+
expect(result![0].steps[0].id).to.equal('valid-step');
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it('should return undefined when no walkthroughs are contributed', () => {
|
|
318
|
+
const pkg = { name: 'test', publisher: 'pub', contributes: {} } as any;
|
|
319
|
+
const result = (scannerInstance as any).readWalkthroughs(pkg);
|
|
320
|
+
expect(result).to.be.undefined;
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
it('should read multiple walkthroughs', () => {
|
|
324
|
+
const result = callReadWalkthroughs([
|
|
325
|
+
{
|
|
326
|
+
id: 'wt1',
|
|
327
|
+
title: 'Walkthrough 1',
|
|
328
|
+
description: 'First',
|
|
329
|
+
steps: [{ id: 's1', title: 'S1', description: 'd1' }]
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: 'wt2',
|
|
333
|
+
title: 'Walkthrough 2',
|
|
334
|
+
description: 'Second',
|
|
335
|
+
steps: [{ id: 's2', title: 'S2', description: 'd2' }]
|
|
336
|
+
}
|
|
337
|
+
]);
|
|
338
|
+
|
|
339
|
+
expect(result).to.have.lengthOf(2);
|
|
340
|
+
expect(result![0].id).to.equal('wt1');
|
|
341
|
+
expect(result![1].id).to.equal('wt2');
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
it('should preserve walkthrough optional fields', () => {
|
|
345
|
+
const result = callReadWalkthroughs([{
|
|
346
|
+
id: 'wt-full',
|
|
347
|
+
title: 'Full Walkthrough',
|
|
348
|
+
description: 'Full desc',
|
|
349
|
+
steps: [{
|
|
350
|
+
id: 's1',
|
|
351
|
+
title: 'S1',
|
|
352
|
+
description: 'step desc',
|
|
353
|
+
when: 'isLinux',
|
|
354
|
+
media: { markdown: 'content.md' },
|
|
355
|
+
completionEvents: ['onCommand:test']
|
|
356
|
+
}],
|
|
357
|
+
when: 'workspacePlatform == linux',
|
|
358
|
+
icon: 'book'
|
|
359
|
+
}]);
|
|
360
|
+
|
|
361
|
+
expect(result).to.have.lengthOf(1);
|
|
362
|
+
expect(result![0].when).to.equal('workspacePlatform == linux');
|
|
363
|
+
expect(result![0].icon).to.equal('book');
|
|
364
|
+
expect(result![0].steps[0].when).to.equal('isLinux');
|
|
365
|
+
expect(result![0].steps[0].media).to.deep.equal({ markdown: 'hostedPlugin/test_publisher_test_plugin/content.md' });
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it('should lowercase pluginId', () => {
|
|
369
|
+
const result = callReadWalkthroughs([{
|
|
370
|
+
id: 'wt1',
|
|
371
|
+
title: 'WT',
|
|
372
|
+
description: 'desc',
|
|
373
|
+
steps: [{ id: 's1', title: 'S1', description: 'd1' }]
|
|
374
|
+
}], 'MyPublisher', 'MyPlugin');
|
|
375
|
+
|
|
376
|
+
expect(result).to.have.lengthOf(1);
|
|
377
|
+
expect(result![0].pluginId).to.equal('mypublisher.myplugin');
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
it('should resolve media image paths through toPluginUrl', () => {
|
|
381
|
+
const result = callReadWalkthroughs([{
|
|
382
|
+
id: 'wt1',
|
|
383
|
+
title: 'WT',
|
|
384
|
+
description: 'desc',
|
|
385
|
+
steps: [{
|
|
386
|
+
id: 's1',
|
|
387
|
+
title: 'S1',
|
|
388
|
+
description: 'd1',
|
|
389
|
+
media: { image: 'media/image.png' }
|
|
390
|
+
}]
|
|
391
|
+
}]);
|
|
392
|
+
|
|
393
|
+
expect(result).to.have.lengthOf(1);
|
|
394
|
+
expect(result![0].steps[0].media).to.deep.equal({ image: 'hostedPlugin/test_publisher_test_plugin/media/image.png' });
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
it('should keep the alt text of svg media', () => {
|
|
398
|
+
const result = callReadWalkthroughs([{
|
|
399
|
+
id: 'wt1',
|
|
400
|
+
title: 'WT',
|
|
401
|
+
description: 'desc',
|
|
402
|
+
steps: [{
|
|
403
|
+
id: 's1',
|
|
404
|
+
title: 'S1',
|
|
405
|
+
description: 'd1',
|
|
406
|
+
media: { svg: 'media/icon.svg', altText: 'An icon' }
|
|
407
|
+
}]
|
|
408
|
+
}]);
|
|
409
|
+
|
|
410
|
+
expect(result![0].steps[0].media).to.deep.equal({
|
|
411
|
+
svg: 'hostedPlugin/test_publisher_test_plugin/media/icon.svg',
|
|
412
|
+
altText: 'An icon'
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
it('should resolve media svg paths through toPluginUrl', () => {
|
|
417
|
+
const result = callReadWalkthroughs([{
|
|
418
|
+
id: 'wt1',
|
|
419
|
+
title: 'WT',
|
|
420
|
+
description: 'desc',
|
|
421
|
+
steps: [{
|
|
422
|
+
id: 's1',
|
|
423
|
+
title: 'S1',
|
|
424
|
+
description: 'd1',
|
|
425
|
+
media: { svg: 'media/icon.svg' }
|
|
426
|
+
}]
|
|
427
|
+
}]);
|
|
428
|
+
|
|
429
|
+
expect(result).to.have.lengthOf(1);
|
|
430
|
+
expect(result![0].steps[0].media).to.deep.equal({ svg: 'hostedPlugin/test_publisher_test_plugin/media/icon.svg' });
|
|
431
|
+
});
|
|
432
|
+
});
|