add some test for invalid ids
Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
This commit is contained in:
@@ -142,6 +142,17 @@ describe('createFrontendPlugin', () => {
|
||||
expect(String(plugin)).toBe('Plugin{id=test}');
|
||||
});
|
||||
|
||||
it('should warn about invalid plugin IDs', () => {
|
||||
const consoleWarn = jest
|
||||
.spyOn(console, 'warn')
|
||||
.mockImplementation(() => {});
|
||||
createFrontendPlugin({ pluginId: 'invalid&id' });
|
||||
expect(consoleWarn).toHaveBeenCalledWith(
|
||||
expect.stringContaining("The pluginId 'invalid&id' will be invalid soon"),
|
||||
);
|
||||
consoleWarn.mockRestore();
|
||||
});
|
||||
|
||||
it('should create a plugin with extension instances', async () => {
|
||||
const plugin = createFrontendPlugin({
|
||||
pluginId: 'test',
|
||||
|
||||
Reference in New Issue
Block a user