mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
Allow updating project annotations before selection
This commit is contained in:
parent
08abb0274d
commit
c6d0b40f1e
@ -3144,6 +3144,16 @@ describe('PreviewWeb', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('with no selection', () => {
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('does not error', async () => {
|
||||
const preview = await createAndRenderPreview();
|
||||
await preview.onGetProjectAnnotationsChanged({
|
||||
getProjectAnnotations: newGetProjectAnnotations,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('shows an error the new value throws', async () => {
|
||||
document.location.search = '?id=component-one--a';
|
||||
const preview = await createAndRenderPreview();
|
||||
|
@ -181,7 +181,9 @@ export class PreviewWeb<TFramework extends AnyFramework> extends Preview<TFramew
|
||||
}) {
|
||||
await super.onGetProjectAnnotationsChanged({ getProjectAnnotations });
|
||||
|
||||
this.renderSelection();
|
||||
if (this.urlStore.selection) {
|
||||
this.renderSelection();
|
||||
}
|
||||
}
|
||||
|
||||
// This happens when a glob gets HMR-ed
|
||||
|
Loading…
x
Reference in New Issue
Block a user