Skip to content

Node.js based forum software built for the modern web

test: add plugin id tests

Barış Soner Uşaklıe8befbcc6f0b
diff --git a/test/plugins.js b/test/plugins.js
index 1260f8fd71..582823b33a 100644
--- a/test/plugins.js
+++ b/test/plugins.js
@@ -262,6 +262,18 @@ describe('Plugins', () => {
});
});
+ it('should error if plugin id is invalid', async () => {
+ await assert.rejects(
+ plugins.toggleActive('\t\nnodebb-plugin'),
+ { message: '[[error:invalid-plugin-id]]' }
+ );
+
+ await assert.rejects(
+ plugins.toggleActive('notaplugin'),
+ { message: '[[error:invalid-plugin-id]]' }
+ );
+ });
+
it('should upgrade plugin', function (done) {
this.timeout(0);
plugins.upgrade(pluginName, 'latest', (err, isActive) => {