Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
16
frontend/tests/pluginTrust.test.ts
Normal file
16
frontend/tests/pluginTrust.test.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { describe, expect, test } from 'vitest';
|
||||
import { isOfficialPlugin } from '../src/features/plugins/pluginResources';
|
||||
import type { PluginStoreEntry } from '../src/types';
|
||||
|
||||
const pluginEntry = (sourceId: string, repository: string) =>
|
||||
({ sourceId, repository }) as PluginStoreEntry;
|
||||
|
||||
describe('plugin store trust', () => {
|
||||
test('trusts only the official source with an official repository', () => {
|
||||
expect(isOfficialPlugin(pluginEntry('official', 'router-for-me/example-plugin'))).toBe(true);
|
||||
expect(isOfficialPlugin(pluginEntry('third-party', 'router-for-me/example-plugin'))).toBe(
|
||||
false
|
||||
);
|
||||
expect(isOfficialPlugin(pluginEntry('official', 'someone-else/example-plugin'))).toBe(false);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue