1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Mobile,Desktop: Resolves #10206: Allow marking a plugin as mobile-only or desktop-only (#10229)

This commit is contained in:
Henry Heino
2024-04-03 10:51:09 -07:00
committed by GitHub
parent 8630c8e630
commit f899c97c4c
31 changed files with 420 additions and 41 deletions

View File

@@ -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',