mirror of
https://github.com/morten-olsen/parcel.git
synced 2026-02-08 01:36:24 +01:00
feat: Add E2E tests (#4)
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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 />}
|
||||
|
||||
@@ -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
1
src/global.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
declare var testUrl: string;
|
||||
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user