Storyshots: fix broken storyshots with angular #23555
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #23549
What I did
Storyshots + angular is broken in 7.x due to the ngModule metadata not being passed, which results in a crash here due to
analyzedMetadata
beingundefined
:storybook/code/frameworks/angular/src/client/angular-beta/StorybookWrapperComponent.ts
Line 61 in 379e484
Fixed by correcting the type to no longer make
analyzedMetadata
optional and passing in the expectedanalyzedMetadata
value.How to test
I applied this patch locally to our application and verified that storyshots with angular now work.
Checklist
MIGRATION.MD
Maintainers
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]