Skip to content

Commit

Permalink
Test for experimental_TEST_PROVIDER addon type
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Sep 13, 2024
1 parent 40ca30b commit b423331
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions code/core/src/manager-api/tests/addons.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,21 @@ const PANELS = {
},
};

const TEST_PROVIDERS = {
'storybook/test/test-provider': {
id: 'storybook/test/test-provider',
title: 'Component tests',
},
}

const provider = {
getElements(type) {
if (type === types.PANEL) {
return PANELS;
}
if (type === types.experimental_TEST_PROVIDER) {
return TEST_PROVIDERS;
}
return null;
},
};
Expand All @@ -38,14 +48,13 @@ const store = {
describe('Addons API', () => {
describe('#getElements', () => {
it('should return provider elements', () => {
// given
const { api } = initAddons({ provider, store });

// when
const panels = api.getElements(types.PANEL);

// then
expect(panels).toBe(PANELS);

const testProviders = api.getElements(types.experimental_TEST_PROVIDER);
expect(testProviders).toBe(TEST_PROVIDERS);
});
});

Expand Down

0 comments on commit b423331

Please sign in to comment.