test(downloading): add downloading test

This commit is contained in:
Alexey Kasyanchuk
2018-12-02 21:13:25 +03:00
parent d8eb395e7d
commit 7277ffba8f
6 changed files with 68 additions and 6 deletions

View File

@ -40,7 +40,7 @@ export default class ContextMenu extends Component {
zIndex: 3
}, !this.props.rightAlign ? { left: -30 } : { right: -30 })}>
{
this.props.menu && this.props.menu.map((menu, index) => <ListItem key={index} style={{fontSize: '0.9em'}} primaryText={menu.name} leftIcon={menu.icon} onClick={(e) => {
this.props.menu && this.props.menu.map((menu, index) => <ListItem key={index} className={menu.className} style={{fontSize: '0.9em'}} primaryText={menu.name} leftIcon={menu.icon} onClick={(e) => {
menu.click()
this.setState({toggle: !this.state.toggle})
e.preventDefault()

View File

@ -16,7 +16,9 @@ export default (props) => {
if(props.onAdded)
props.onAdded(added)
})
}, icon: <svg style={{
},
className: 'downloadFullButton',
icon: <svg style={{
fill: 'black'
}} viewBox="0 0 56 56">
<g>

View File

@ -371,7 +371,7 @@ export default class Torrent extends Component {
mode="determinate"
value={this.state.downloadProgress && (this.state.downloadProgress.progress ? this.state.downloadProgress.progress : 0) * 100}
/>
<div className='pad0-75' style={{marginLeft: 20}} style={{color: 'rgb(0, 188, 212)'}}>{this.state.downloadProgress && (this.state.downloadProgress.progress * 100).toFixed(1)}%</div>
<div className='pad0-75 progressDownloading' style={{marginLeft: 20}} style={{color: 'rgb(0, 188, 212)'}}>{this.state.downloadProgress && (this.state.downloadProgress.progress * 100).toFixed(1)}%</div>
{
this.state.downloadProgress.progress !== 1
&&
@ -463,7 +463,7 @@ export default class Torrent extends Component {
this.setState({startingDownloading: true})
}}>
<ToolTip hint={__('Download using built-in client')} right={true}>
<a href={`magnet:?xt=urn:btih:${torrent.hash}`}>
<a className='downloadButton' href={`magnet:?xt=urn:btih:${torrent.hash}`}>
<svg style={{
height: '24px',
marginRight: 12,
@ -515,7 +515,7 @@ export default class Torrent extends Component {
this.state.downloaded
?
<ToolTip hint={__('Delete download (files saved)')} right={true}>
<a href={`magnet:?xt=urn:btih:${torrent.hash}`}>
<a className='deleteDownload deleteDownloadAfterFinish' href={`magnet:?xt=urn:btih:${torrent.hash}`}>
<svg style={{
height: '24px',
fill: '#00C853',
@ -532,7 +532,7 @@ export default class Torrent extends Component {
this.state.downloading
&&
<ToolTip hint={__('Delete download (files saved)')} right={true}>
<a href={`magnet:?xt=urn:btih:${torrent.hash}`}>
<a className='deleteDownload deleteDownloadBeforeFinish' href={`magnet:?xt=urn:btih:${torrent.hash}`}>
<svg style={{
height: '24px',
marginRight: 12,