mirror of https://github.com/msgbyte/tailchat
test: add some testcase
parent
fd533d5b99
commit
d96d137893
@ -0,0 +1,10 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { AlertErrorView } from '../AlertErrorView';
|
||||
|
||||
describe('AlertErrorView', () => {
|
||||
test('render', () => {
|
||||
const wrapper = render(<AlertErrorView error={new Error('Dummy Error')} />);
|
||||
expect(wrapper.container).toMatchSnapshot();
|
||||
});
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { Highlight } from '../Highlight';
|
||||
|
||||
describe('Highlight', () => {
|
||||
test('render', () => {
|
||||
const wrapper = render(<Highlight>Any Text</Highlight>);
|
||||
expect(wrapper.container).toMatchSnapshot();
|
||||
});
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { IconBtn } from '../IconBtn';
|
||||
|
||||
describe('IconBtn', () => {
|
||||
test('render', () => {
|
||||
const wrapper = render(<IconBtn icon="mdi-close" />);
|
||||
expect(wrapper.container).toMatchSnapshot();
|
||||
});
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { IsDeveloping } from '../IsDeveloping';
|
||||
|
||||
describe('IsDeveloping', () => {
|
||||
test('render', () => {
|
||||
const wrapper = render(<IsDeveloping />);
|
||||
expect(wrapper.container).toMatchSnapshot();
|
||||
});
|
||||
});
|
@ -0,0 +1,19 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { PillTabs, PillTabPane } from '../PillTabs';
|
||||
|
||||
describe('PillTabs', () => {
|
||||
test('render', () => {
|
||||
const wrapper = render(
|
||||
<PillTabs>
|
||||
<PillTabPane tab="t1" key="1">
|
||||
1
|
||||
</PillTabPane>
|
||||
<PillTabPane tab="t2" key="2">
|
||||
2
|
||||
</PillTabPane>
|
||||
</PillTabs>
|
||||
);
|
||||
expect(wrapper.container).toMatchSnapshot();
|
||||
});
|
||||
});
|
@ -0,0 +1,26 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`AlertErrorView render 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-alert ant-alert-error ant-alert-with-description ant-alert-no-icon"
|
||||
data-show="true"
|
||||
role="alert"
|
||||
>
|
||||
<div
|
||||
class="ant-alert-content"
|
||||
>
|
||||
<div
|
||||
class="ant-alert-message"
|
||||
>
|
||||
Error
|
||||
</div>
|
||||
<div
|
||||
class="ant-alert-description"
|
||||
>
|
||||
Dummy Error
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
@ -0,0 +1,11 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Highlight render 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="bg-black bg-opacity-20 rounded py-1 px-2"
|
||||
>
|
||||
Any Text
|
||||
</span>
|
||||
</div>
|
||||
`;
|
@ -0,0 +1,12 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`IconBtn render 1`] = `
|
||||
<div>
|
||||
<button
|
||||
class="ant-btn ant-btn-circle ant-btn-icon-only border-0 bg-black bg-opacity-30 text-white text-opacity-80 hover:text-opacity-100 hover:bg-opacity-60"
|
||||
type="button"
|
||||
>
|
||||
<span />
|
||||
</button>
|
||||
</div>
|
||||
`;
|
@ -0,0 +1,16 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`IsDeveloping render 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="text-white w-full h-full flex items-center justify-center flex-col"
|
||||
>
|
||||
<span />
|
||||
<p
|
||||
class="text-2xl"
|
||||
>
|
||||
该功能暂未开放
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
@ -0,0 +1,117 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`PillTabs render 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-tabs ant-tabs-top ant-tabs-card pill-tabs"
|
||||
>
|
||||
<div
|
||||
class="ant-tabs-nav"
|
||||
role="tablist"
|
||||
>
|
||||
<div
|
||||
class="ant-tabs-nav-wrap"
|
||||
>
|
||||
<div
|
||||
class="ant-tabs-nav-list"
|
||||
style="transform: translate(0px, 0px);"
|
||||
>
|
||||
<div
|
||||
class="ant-tabs-tab ant-tabs-tab-active"
|
||||
>
|
||||
<div
|
||||
aria-controls="rc-tabs-test-panel-1"
|
||||
aria-selected="true"
|
||||
class="ant-tabs-tab-btn"
|
||||
id="rc-tabs-test-tab-1"
|
||||
role="tab"
|
||||
tabindex="0"
|
||||
>
|
||||
t1
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-tabs-tab"
|
||||
>
|
||||
<div
|
||||
aria-controls="rc-tabs-test-panel-2"
|
||||
aria-selected="false"
|
||||
class="ant-tabs-tab-btn"
|
||||
id="rc-tabs-test-tab-2"
|
||||
role="tab"
|
||||
tabindex="0"
|
||||
>
|
||||
t2
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-tabs-ink-bar ant-tabs-ink-bar-animated"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-tabs-nav-operations ant-tabs-nav-operations-hidden"
|
||||
>
|
||||
<button
|
||||
aria-controls="rc-tabs-test-more-popup"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="listbox"
|
||||
aria-hidden="true"
|
||||
class="ant-tabs-nav-more"
|
||||
id="rc-tabs-test-more"
|
||||
style="visibility: hidden; order: 1;"
|
||||
tabindex="-1"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
aria-label="ellipsis"
|
||||
class="anticon anticon-ellipsis"
|
||||
role="img"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
data-icon="ellipsis"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-tabs-content-holder"
|
||||
>
|
||||
<div
|
||||
class="ant-tabs-content ant-tabs-content-top ant-tabs-content-animated"
|
||||
>
|
||||
<div
|
||||
aria-hidden="false"
|
||||
aria-labelledby="rc-tabs-test-tab-1"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-active"
|
||||
id="rc-tabs-test-panel-1"
|
||||
role="tabpanel"
|
||||
tabindex="0"
|
||||
>
|
||||
1
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
aria-labelledby="rc-tabs-test-tab-2"
|
||||
class="ant-tabs-tabpane"
|
||||
id="rc-tabs-test-panel-2"
|
||||
role="tabpanel"
|
||||
style="visibility: hidden; height: 0px; overflow-y: hidden;"
|
||||
tabindex="-1"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
Loading…
Reference in New Issue