Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon API: Add experimental page addon type #23307

Merged
merged 37 commits into from
Jul 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
683c480
add a new addon type: Page, refactor manager layout to allow for pages
ndelangen Jul 4, 2023
f28c739
apply router changes from https://github.com/storybookjs/storybook/pu…
ndelangen Jul 4, 2023
d31d7cb
make `/` the default path, even when there's no query in the URL
ndelangen Jul 4, 2023
2724a96
cleanup
ndelangen Jul 4, 2023
dbc587f
fix an ancient bug where navigating before preview load, the preview …
ndelangen Jul 4, 2023
40daf32
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 4, 2023
6c26daf
cleanup
ndelangen Jul 4, 2023
4486548
fix
ndelangen Jul 4, 2023
ca586a4
fix
ndelangen Jul 4, 2023
3837bdc
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 5, 2023
87e8e14
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 6, 2023
2a8fe23
Merge branch 'norbert/page-addons-refactor' of github.com:storybookjs…
ndelangen Jul 6, 2023
155eb12
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 6, 2023
2a22fc6
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 6, 2023
c9dcee1
Merge branch 'norbert/ui-tabs-types-improvements' into norbert/page-a…
ndelangen Jul 6, 2023
ad0a0fa
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 7, 2023
13ec5f6
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 7, 2023
bce1c1e
rename
ndelangen Jul 7, 2023
d67aeba
cleanup
ndelangen Jul 7, 2023
ccf22aa
I like tests
ndelangen Jul 7, 2023
1af8f33
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 10, 2023
ad444c7
Update code/lib/preview-api/src/modules/preview-web/PreviewWithSelect…
ndelangen Jul 11, 2023
8b33973
remove the fake generic type argument
ndelangen Jul 11, 2023
dde330c
improve readability of api's stories module init
ndelangen Jul 11, 2023
36f4a7a
fix cyclical state setting
ndelangen Jul 11, 2023
9f79059
addon render function are now called like React elements, thus keys a…
ndelangen Jul 11, 2023
d9e2984
fix type issues
ndelangen Jul 11, 2023
80e9be5
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 11, 2023
e981fb2
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 12, 2023
9027184
Merge branch 'norbert/page-addons-refactor' of github.com:storybookjs…
ndelangen Jul 12, 2023
428e6ce
add test for early setting of selection in preview-web
ndelangen Jul 12, 2023
701d560
add migration documentation
ndelangen Jul 12, 2023
f0b368d
move test
ndelangen Jul 12, 2023
f2b43c9
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 12, 2023
2aa315e
Straighten out behaviour when messages are received during init
tmeasday Jul 13, 2023
df8bf31
fix
ndelangen Jul 13, 2023
d5b712b
Merge branch 'release/7.2' into norbert/page-addons-refactor
ndelangen Jul 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,32 @@ describe('PreviewWeb', () => {
jest.useRealTimers();
});

it('listens for events during setup', async () => {
ndelangen marked this conversation as resolved.
Show resolved Hide resolved
document.location.search = '?id=component-one--a';

const initialized = new PreviewWeb().initialize({
importFn,
getProjectAnnotations,
});

emitter.emit(SET_CURRENT_STORY, {
storyId: 'component-one--b',
viewMode: 'story',
});

await initialized;

await waitForRender();

await waitForSetCurrentStory();

expect(history.replaceState).toHaveBeenCalledWith(
{},
'',
'pathname?id=component-one--b&viewMode=story'
);
});

it('updates URL', async () => {
document.location.search = '?id=component-one--a';
await createAndRenderPreview();
Expand Down