Added a unit test

Signed-off-by: bnechyporenko <bnechyporenko@bol.com>
This commit is contained in:
bnechyporenko
2022-05-10 09:34:52 +02:00
parent 82996af90b
commit d2d41c6f13
@@ -32,3 +32,35 @@ describe('Plugin Feature Flag', () => {
).toEqual([]);
});
});
describe('Plugin metadata', () => {
it('should be able to define metadata', () => {
expect(
createPlugin({
id: 'test',
metadata: {
key: 'value',
},
}).getMetadata(),
).toEqual({
key: 'value',
});
});
it('should be able to reconfigure metadata', () => {
const plugin = createPlugin({
id: 'test',
metadata: {
key: 'original-value',
},
});
plugin.reconfigure({
key: 'modified-value',
});
expect(plugin.getMetadata()).toEqual({
key: 'modified-value',
});
});
});