You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
This commit is contained in:
@@ -57,6 +57,28 @@ describe('validateUntrustedManifest', () => {
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
test('should only allow valid plugin platforms', () => {
|
||||
const badManifest = {
|
||||
id: 'com.example.a-plugin-for-a-fake-platform',
|
||||
_npm_package_name: 'joplin-plugin-plugin-for-an-invalid-version',
|
||||
version: '1.2.3',
|
||||
platforms: [3, 4, 5],
|
||||
};
|
||||
|
||||
expect(
|
||||
() => validateUntrustedManifest(badManifest, originalManifests),
|
||||
).toThrow();
|
||||
|
||||
const goodManifest = {
|
||||
...badManifest,
|
||||
platforms: ['mobile', 'desktop'],
|
||||
};
|
||||
|
||||
expect(
|
||||
() => validateUntrustedManifest(goodManifest, originalManifests),
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
test('should not allow plugin authors to mark their own plugins as recommended', () => {
|
||||
const newManifest1 = {
|
||||
id: 'joplin-plugin.this.is.another.test',
|
||||
|
||||
Reference in New Issue
Block a user