feat: Add E2E tests (#4)

This commit is contained in:
2021-04-11 23:27:13 +02:00
committed by GitHub
parent e590d40db7
commit 6c16252b3b
16 changed files with 2618 additions and 43 deletions

View File

@@ -67,6 +67,7 @@ const FileView: React.FC<Props> = ({
actions.push(
<IconText
icon={DownloadOutlined}
className="msg-download"
type="primary"
text="Download"
onClick={() => downloadLink(file.name, file.blob!)}
@@ -77,6 +78,7 @@ const FileView: React.FC<Props> = ({
return (
<List.Item
actions={actions}
className="msg-item"
>
<List.Item.Meta
avatar={icon}

View File

@@ -13,8 +13,8 @@ const Add: React.FC = () => {
<>
<Divider>
<Radio.Group onChange={evt => setType(evt.target.value)} defaultValue={DEFAULT_VALUE}>
<Radio.Button value="text"><FileTextOutlined /> Text</Radio.Button>
<Radio.Button value="file"><FileOutlined /> File</Radio.Button>
<Radio.Button className="add-text-tab" value="text"><FileTextOutlined /> Text</Radio.Button>
<Radio.Button className="add-file-tab" value="file"><FileOutlined /> File</Radio.Button>
</Radio.Group>
</Divider>
{type === 'text' && <AddText />}

View File

@@ -19,12 +19,14 @@ const AddText : React.FC = () => {
<Form.Item>
<Input
placeholder="Title"
className="msg-title"
value={name}
onChange={evt => setName(evt.target.value)}
/>
</Form.Item>
<Form.Item>
<Input.TextArea
className="msg-body"
placeholder="Your message here..."
value={text}
rows={6}
@@ -34,6 +36,7 @@ const AddText : React.FC = () => {
<Form.Item>
<Button
onClick={add}
className="msg-add"
type="primary"
icon={<PlusOutlined />}
disabled={!text}

1
src/global.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare var testUrl: string;

View File

@@ -16,6 +16,7 @@ const Thumb: React.FC = ({
title,
Icon,
link,
className,
}) => {
const history = useHistory();
return (
@@ -23,6 +24,7 @@ const Thumb: React.FC = ({
size="large"
icon={<Icon />}
type="link"
className={className}
onClick={() => history.push(link)}
>
{title}
@@ -39,15 +41,18 @@ const Intro = () => {
<Thumb
title="I want to send a text/file"
link="/send"
className="send-btn"
Icon={UploadOutlined}
/>
<Thumb
link="/key"
className="want-to-receive-btn"
title="I want to receive a file"
Icon={KeyOutlined}
/>
<Thumb
link="/receive"
className="did-receive-btn"
title="I have received a file"
Icon={DownloadOutlined}
/>