Browse Source

demo: fixed the avatars are all the same picture (#40809)

* demo: update demo

* update snap

* update snap

* update snap
pull/40808/head
lijianan 2 years ago
committed by GitHub
parent
commit
33275b6e80
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      components/avatar/__tests__/Avatar.test.tsx
  2. 4
      components/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap
  3. 6
      components/avatar/__tests__/__snapshots__/demo-extend.test.ts.snap
  4. 6
      components/avatar/__tests__/__snapshots__/demo.test.tsx.snap
  5. 10
      components/avatar/demo/group.tsx
  6. 10
      components/card/demo/loading.tsx
  7. 14
      components/config-provider/__tests__/__snapshots__/components.test.tsx.snap
  8. 4
      components/config-provider/__tests__/components.test.tsx
  9. 4
      components/list/__tests__/Item.test.tsx
  10. 22
      components/list/__tests__/__snapshots__/demo-extend.test.ts.snap
  11. 22
      components/list/__tests__/__snapshots__/demo.test.ts.snap
  12. 6
      components/list/demo/basic.tsx
  13. 8
      components/list/demo/pagination.tsx
  14. 6
      components/list/demo/vertical.tsx
  15. 8
      components/skeleton/demo/list.tsx
  16. 8
      components/steps/__tests__/__snapshots__/demo-extend.test.ts.snap
  17. 8
      components/steps/__tests__/__snapshots__/demo.test.ts.snap
  18. 8
      components/steps/demo/inline.tsx
  19. 1
      tests/setup.js

8
components/avatar/__tests__/Avatar.test.tsx

@ -53,7 +53,7 @@ describe('Avatar Render', () => {
it('should handle onError correctly', () => {
const LOAD_FAILURE_SRC = 'http://error.url/';
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';
const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random';
const Foo: React.FC = () => {
const [avatarSrc, setAvatarSrc] = useState<typeof LOAD_FAILURE_SRC | typeof LOAD_SUCCESS_SRC>(
LOAD_FAILURE_SRC,
@ -75,7 +75,7 @@ describe('Avatar Render', () => {
it('should show image on success after a failure state', () => {
const LOAD_FAILURE_SRC = 'http://error.url';
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';
const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random';
const div = global.document.createElement('div');
global.document.body.appendChild(div);
@ -172,7 +172,7 @@ describe('Avatar Render', () => {
});
it('should exist crossorigin attribute', () => {
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';
const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random';
const crossOrigin = 'anonymous';
const { container } = render(
<Avatar src={LOAD_SUCCESS_SRC} crossOrigin={crossOrigin}>
@ -184,7 +184,7 @@ describe('Avatar Render', () => {
});
it('should not exist crossorigin attribute', () => {
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';
const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random';
const { container } = render(<Avatar src={LOAD_SUCCESS_SRC}>crossorigin</Avatar>);
expect(container.querySelector('img')?.crossOrigin).toBeFalsy();
expect(container.querySelector('img')?.crossOrigin).toEqual('');

4
components/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap

@ -140,7 +140,7 @@ exports[`Avatar Render should handle onError correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joeschmoe.io/api/v1/random"
src="https://joesch.moe/api/v1/random"
/>
</span>
`;
@ -163,7 +163,7 @@ exports[`Avatar Render should show image on success after a failure state 2`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joeschmoe.io/api/v1/random"
src="https://joesch.moe/api/v1/random"
/>
</span>
`;

6
components/avatar/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -415,7 +415,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
<a
@ -517,7 +517,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
<span
@ -653,7 +653,7 @@ Array [
class="ant-avatar ant-avatar-lg ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=3"
/>
</span>
<span

6
components/avatar/__tests__/__snapshots__/demo.test.tsx.snap

@ -415,7 +415,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
<a
@ -493,7 +493,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
<span
@ -530,7 +530,7 @@ Array [
class="ant-avatar ant-avatar-lg ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=3"
/>
</span>
<span

10
components/avatar/demo/group.tsx

@ -1,11 +1,11 @@
import { AntDesignOutlined, UserOutlined } from '@ant-design/icons';
import { Avatar, Divider, Tooltip } from 'antd';
import React from 'react';
import { AntDesignOutlined,UserOutlined } from '@ant-design/icons';
import { Avatar,Divider,Tooltip } from 'antd';
const App: React.FC = () => (
<>
<Avatar.Group>
<Avatar src="https://joesch.moe/api/v1/random" />
<Avatar src="https://joesch.moe/api/v1/random?key=1" />
<a href="https://ant.design">
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
</a>
@ -16,7 +16,7 @@ const App: React.FC = () => (
</Avatar.Group>
<Divider />
<Avatar.Group maxCount={2} maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>
<Avatar src="https://joesch.moe/api/v1/random" />
<Avatar src="https://joesch.moe/api/v1/random?key=2" />
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
<Tooltip title="Ant User" placement="top">
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
@ -29,7 +29,7 @@ const App: React.FC = () => (
size="large"
maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}
>
<Avatar src="https://joesch.moe/api/v1/random" />
<Avatar src="https://joesch.moe/api/v1/random?key=3" />
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
<Tooltip title="Ant User" placement="top">
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />

10
components/card/demo/loading.tsx

@ -1,6 +1,6 @@
import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons';
import { Avatar, Card, Skeleton, Switch } from 'antd';
import React, { useState } from 'react';
import { EditOutlined,EllipsisOutlined,SettingOutlined } from '@ant-design/icons';
import { Avatar,Card,Skeleton,Switch } from 'antd';
const { Meta } = Card;
@ -14,15 +14,13 @@ const App: React.FC = () => {
return (
<>
<Switch checked={!loading} onChange={onChange} />
<Card style={{ width: 300, marginTop: 16 }} loading={loading}>
<Meta
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
avatar={<Avatar src="https://joesch.moe/api/v1/random?key=1" />}
title="Card title"
description="This is the description"
/>
</Card>
<Card
style={{ width: 300, marginTop: 16 }}
actions={[
@ -33,7 +31,7 @@ const App: React.FC = () => {
>
<Skeleton loading={loading} avatar active>
<Meta
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
avatar={<Avatar src="https://joesch.moe/api/v1/random?key=2" />}
title="Card title"
description="This is the description"
/>

14
components/config-provider/__tests__/__snapshots__/components.test.tsx.snap

@ -17327,7 +17327,7 @@ exports[`ConfigProvider components List configProvider 1`] = `
class="config-avatar config-avatar-circle config-avatar-image"
>
<img
src="https://joeschmoe.io/api/v1/random"
src="https://joesch.moe/api/v1/random"
/>
</span>
</div>
@ -17379,7 +17379,7 @@ exports[`ConfigProvider components List configProvider componentDisabled 1`] = `
class="config-avatar config-avatar-circle config-avatar-image"
>
<img
src="https://joeschmoe.io/api/v1/random"
src="https://joesch.moe/api/v1/random"
/>
</span>
</div>
@ -17431,7 +17431,7 @@ exports[`ConfigProvider components List configProvider componentSize large 1`] =
class="config-avatar config-avatar-circle config-avatar-image"
>
<img
src="https://joeschmoe.io/api/v1/random"
src="https://joesch.moe/api/v1/random"
/>
</span>
</div>
@ -17483,7 +17483,7 @@ exports[`ConfigProvider components List configProvider componentSize middle 1`]
class="config-avatar config-avatar-circle config-avatar-image"
>
<img
src="https://joeschmoe.io/api/v1/random"
src="https://joesch.moe/api/v1/random"
/>
</span>
</div>
@ -17535,7 +17535,7 @@ exports[`ConfigProvider components List configProvider virtual and dropdownMatch
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joeschmoe.io/api/v1/random"
src="https://joesch.moe/api/v1/random"
/>
</span>
</div>
@ -17587,7 +17587,7 @@ exports[`ConfigProvider components List normal 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joeschmoe.io/api/v1/random"
src="https://joesch.moe/api/v1/random"
/>
</span>
</div>
@ -17639,7 +17639,7 @@ exports[`ConfigProvider components List prefixCls 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joeschmoe.io/api/v1/random"
src="https://joesch.moe/api/v1/random"
/>
</span>
</div>

4
components/config-provider/__tests__/components.test.tsx

@ -40,6 +40,7 @@ import Skeleton from '../../skeleton';
import type { SliderTooltipProps } from '../../slider';
import Slider from '../../slider';
// eslint-disable-next-line import/no-named-as-default
import { render } from '../../../tests/utils';
import Spin from '../../spin';
import Statistic from '../../statistic';
import Steps from '../../steps';
@ -55,7 +56,6 @@ import Transfer from '../../transfer';
import Tree from '../../tree';
import TreeSelect from '../../tree-select';
import Upload from '../../upload';
import { render } from '../../../tests/utils';
dayjs.extend(customParseFormat);
jest.mock('rc-util/lib/Portal');
@ -351,7 +351,7 @@ describe('ConfigProvider', () => {
<List.Item {...props}>
<List.Item.Meta
{...props}
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
title="Ant Design"
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>

4
components/list/__tests__/Item.test.tsx

@ -8,8 +8,8 @@ describe('List Item Layout', () => {
{
key: 1,
href: 'https://ant.design',
title: `ant design`,
avatar: 'https://joeschmoe.io/api/v1/random',
title: 'ant design',
avatar: 'https://joesch.moe/api/v1/random',
description:
'Ant Design, a design language for background applications, is refined by Ant UED Team.',
content:

22
components/list/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -26,7 +26,7 @@ exports[`renders ./components/list/demo/basic.tsx extend context correctly 1`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=0"
/>
</span>
</div>
@ -63,7 +63,7 @@ exports[`renders ./components/list/demo/basic.tsx extend context correctly 1`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
</div>
@ -100,7 +100,7 @@ exports[`renders ./components/list/demo/basic.tsx extend context correctly 1`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
</div>
@ -137,7 +137,7 @@ exports[`renders ./components/list/demo/basic.tsx extend context correctly 1`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=3"
/>
</span>
</div>
@ -1360,7 +1360,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=0"
/>
</span>
</div>
@ -1397,7 +1397,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
</div>
@ -1434,7 +1434,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
</div>
@ -1471,7 +1471,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=3"
/>
</span>
</div>
@ -2072,7 +2072,7 @@ exports[`renders ./components/list/demo/vertical.tsx extend context correctly 1`
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=0"
/>
</span>
</div>
@ -2238,7 +2238,7 @@ exports[`renders ./components/list/demo/vertical.tsx extend context correctly 1`
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
</div>
@ -2404,7 +2404,7 @@ exports[`renders ./components/list/demo/vertical.tsx extend context correctly 1`
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
</div>

22
components/list/__tests__/__snapshots__/demo.test.ts.snap

@ -26,7 +26,7 @@ exports[`renders ./components/list/demo/basic.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=0"
/>
</span>
</div>
@ -63,7 +63,7 @@ exports[`renders ./components/list/demo/basic.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
</div>
@ -100,7 +100,7 @@ exports[`renders ./components/list/demo/basic.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
</div>
@ -137,7 +137,7 @@ exports[`renders ./components/list/demo/basic.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=3"
/>
</span>
</div>
@ -1360,7 +1360,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=0"
/>
</span>
</div>
@ -1397,7 +1397,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
</div>
@ -1434,7 +1434,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
</div>
@ -1471,7 +1471,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=3"
/>
</span>
</div>
@ -2072,7 +2072,7 @@ exports[`renders ./components/list/demo/vertical.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=0"
/>
</span>
</div>
@ -2238,7 +2238,7 @@ exports[`renders ./components/list/demo/vertical.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
</div>
@ -2404,7 +2404,7 @@ exports[`renders ./components/list/demo/vertical.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
</div>

6
components/list/demo/basic.tsx

@ -1,5 +1,5 @@
import React from 'react';
import { Avatar, List } from 'antd';
import React from 'react';
const data = [
{
@ -20,10 +20,10 @@ const App: React.FC = () => (
<List
itemLayout="horizontal"
dataSource={data}
renderItem={(item) => (
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
avatar={<Avatar src={`https://joesch.moe/api/v1/random?key=${index}`} />}
title={<a href="https://ant.design">{item.title}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>

8
components/list/demo/pagination.tsx

@ -1,5 +1,5 @@
import { Avatar, List, Radio, Space } from 'antd';
import React, { useState } from 'react';
import { Avatar, List, Space, Radio } from 'antd';
type PaginationPosition = 'top' | 'bottom' | 'both';
@ -30,7 +30,7 @@ const App: React.FC = () => {
return (
<>
<Space direction='vertical' style={{ marginBottom: '20px' }} size="middle">
<Space direction="vertical" style={{ marginBottom: '20px' }} size="middle">
<Space>
<span>Pagination Position:</span>
<Radio.Group
@ -67,10 +67,10 @@ const App: React.FC = () => {
<List
pagination={{ position, align }}
dataSource={data}
renderItem={(item) => (
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
avatar={<Avatar src={`https://joesch.moe/api/v1/random?key=${index}`} />}
title={<a href="https://ant.design">{item.title}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>

6
components/list/demo/vertical.tsx

@ -1,11 +1,11 @@
import { LikeOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons';
import { Avatar, List, Space } from 'antd';
import React from 'react';
import { LikeOutlined,MessageOutlined,StarOutlined } from '@ant-design/icons';
import { Avatar,List,Space } from 'antd';
const data = Array.from({ length: 23 }).map((_, i) => ({
href: 'https://ant.design',
title: `ant design part ${i}`,
avatar: 'https://joesch.moe/api/v1/random',
avatar: `https://joesch.moe/api/v1/random?key=${i}`,
description:
'Ant Design, a design language for background applications, is refined by Ant UED Team.',
content:

8
components/skeleton/demo/list.tsx

@ -1,7 +1,7 @@
import type Icon from '@ant-design/icons';
import { LikeOutlined,MessageOutlined,StarOutlined } from '@ant-design/icons';
import { Avatar,List,Skeleton,Switch } from 'antd';
import React,{ useState } from 'react';
import { LikeOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons';
import { Avatar, List, Skeleton, Switch } from 'antd';
import React, { useState } from 'react';
interface IconTextProps {
icon: typeof Icon;
@ -11,7 +11,7 @@ interface IconTextProps {
const listData = Array.from({ length: 3 }).map((_, i) => ({
href: 'https://ant.design',
title: `ant design part ${i + 1}`,
avatar: 'https://joesch.moe/api/v1/random',
avatar: `https://joesch.moe/api/v1/random?key=${i}`,
description:
'Ant Design, a design language for background applications, is refined by Ant UED Team.',
content:

8
components/steps/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -895,7 +895,7 @@ exports[`renders ./components/steps/demo/inline.tsx extend context correctly 1`]
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=0"
/>
</span>
</div>
@ -1117,7 +1117,7 @@ exports[`renders ./components/steps/demo/inline.tsx extend context correctly 1`]
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
</div>
@ -1339,7 +1339,7 @@ exports[`renders ./components/steps/demo/inline.tsx extend context correctly 1`]
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
</div>
@ -1561,7 +1561,7 @@ exports[`renders ./components/steps/demo/inline.tsx extend context correctly 1`]
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=3"
/>
</span>
</div>

8
components/steps/__tests__/__snapshots__/demo.test.ts.snap

@ -751,7 +751,7 @@ exports[`renders ./components/steps/demo/inline.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=0"
/>
</span>
</div>
@ -901,7 +901,7 @@ exports[`renders ./components/steps/demo/inline.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=1"
/>
</span>
</div>
@ -1051,7 +1051,7 @@ exports[`renders ./components/steps/demo/inline.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=2"
/>
</span>
</div>
@ -1201,7 +1201,7 @@ exports[`renders ./components/steps/demo/inline.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://joesch.moe/api/v1/random"
src="https://joesch.moe/api/v1/random?key=3"
/>
</span>
</div>

8
components/steps/demo/inline.tsx

@ -1,6 +1,6 @@
import React from 'react';
import type { StepsProps } from 'antd';
import { Steps, List, Avatar } from 'antd';
import { Avatar, List, Steps } from 'antd';
import React from 'react';
const data = [
{
@ -42,10 +42,10 @@ const App: React.FC = () => (
<List
itemLayout="horizontal"
dataSource={data}
renderItem={(item) => (
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
avatar={<Avatar src={`https://joesch.moe/api/v1/random?key=${index}`} />}
title={<a href="https://ant.design">{item.title}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>

1
tests/setup.js

@ -1,3 +1,4 @@
/* eslint-disable no-console */
const React = require('react');
const util = require('util');

Loading…
Cancel
Save