Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Jul 4, 2022
1 parent 96fb6c2 commit c36d10c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/preview-web/src/PreviewWeb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jest.mock('react-dom');
jest.mock('./WebView');

const serializeError = (error: Error) => {
const { name, message, stack } = error;
const { name = 'Error', message = String(error), stack } = error;
return { name, message, stack };
};

Expand Down
5 changes: 3 additions & 2 deletions lib/preview-web/src/StoryRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ export class StoryRender<TFramework extends AnyFramework> implements Render<TFra
this.teardownRender = teardown || (() => {});
});
this.notYetRendered = false;
if (abortSignal.aborted || this.phase !== 'rendering') return;
if (abortSignal.aborted) return;

if (forceRemount && playFunction) {
// The phase should be 'rendering' but it might be set to 'aborted' by another render cycle
if (forceRemount && playFunction && this.phase !== 'errored') {
this.disableKeyListeners = true;
try {
await this.runPhase(abortSignal, 'playing', async () => {
Expand Down

0 comments on commit c36d10c

Please sign in to comment.