Fix some DeepScan issues

This commit is contained in:
Tom Coleman 2020-03-02 11:23:21 +11:00
parent 574570554a
commit 976e30d5d5
3 changed files with 5 additions and 6 deletions

View File

@ -93,7 +93,7 @@ describe('core.preview.StoryRenderer', () => {
);
// the render function does something async so we need to jump to the end of the promise queue
await null;
await Promise.resolve(null);
expect(onStoryRendered).toHaveBeenCalledWith('a--1');
});

View File

@ -1,4 +1,4 @@
import React, { Context } from 'react';
import React from 'react';
import ReactDOM from 'react-dom';
import { document } from 'global';
import AnsiToHtml from 'ansi-to-html';
@ -89,7 +89,7 @@ export class StoryRenderer {
const { storyId, viewMode: urlViewMode } = storyStore.getSelection();
const data = storyStore.fromId(storyId);
const { kind, name, id, parameters = {} } = data || {};
const { kind, id, parameters = {} } = data || {};
const { docsOnly, layout } = parameters;
const metadata: RenderMetadata = {
@ -121,7 +121,7 @@ export class StoryRenderer {
metadata: RenderMetadata;
context: RenderContext;
}) {
const { forceRender, kind, name } = context;
const { forceRender, name } = context;
const { previousMetadata } = this;

View File

@ -1,6 +1,5 @@
import { history, document, window } from 'global';
import { document, window } from 'global';
import Events from '@storybook/core-events';
import start from './start';
jest.mock('@storybook/client-logger');