Skip to content

Commit

Permalink
fix: ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni committed Aug 20, 2020
1 parent e5ea8bb commit 445d173
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/dumi-theme-mobile/src/builtins/Previewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Link,
IPreviewerComponentProps,
} from 'dumi/theme';
import SourceCode from 'dumi-theme-default/es/builtins/SourceCode';
import SourceCode from 'dumi-theme-default/src/builtins/SourceCode';
import Popover from 'antd/es/popover';
// @ts-ignore
import QRCode from 'qrcode.react';
Expand Down
3 changes: 0 additions & 3 deletions packages/dumi-theme-mobile/src/layout.tsx

This file was deleted.

25 changes: 5 additions & 20 deletions packages/dumi-theme-mobile/src/test/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import '@testing-library/jest-dom';
import 'intersection-observer';
import React from 'react';
import { render, queryByAttribute } from '@testing-library/react';
import { render } from '@testing-library/react';
import { createMemoryHistory, MemoryHistory, Router } from '@umijs/runtime';
import { context as Context } from 'dumi/theme';
import Previewer from '../builtins/Previewer';
import Layout from '../layout';
import Content from '../content';

let history: MemoryHistory;

Expand Down Expand Up @@ -82,23 +82,9 @@ describe('mobile theme', () => {
};

it('should render builtin components correctly', () => {
const code = "console.log('Hello World!')";
const wrapper = ({ children }) => (
<Context.Provider
value={{
...baseCtx,
meta: {
title: 'test',
slugs: [{ value: 'Slug A', heading: 'a', depth: 2 }],
},
}}
>
{children}
</Context.Provider>
);
const { getByText, getByTitle, getAllByTitle } = render(
const { getByText, getByTitle } = render(
<Router history={history}>
<Layout {...baseProps}>
<Content {...baseProps}>
<>
<Previewer
title="demo-1"
Expand Down Expand Up @@ -130,9 +116,8 @@ describe('mobile theme', () => {
<>demo-2</>
</Previewer>
</>
</Layout>
</Content>
</Router>,
{ wrapper },
);

expect(getByTitle('dumi mobile').src).toEqual('http://localhost/~demos/demo-1');
Expand Down

0 comments on commit 445d173

Please sign in to comment.