Integration test: torrent list

This commit is contained in:
DC
2016-09-08 16:40:43 -07:00
parent 1ad8a5313b
commit 785c44cd2a
22 changed files with 161 additions and 37 deletions

View File

@@ -36,26 +36,31 @@ module.exports = {
DEFAULT_TORRENTS: [
{
testID: 'bbb',
name: 'Big Buck Bunny',
posterFileName: 'bigBuckBunny.jpg',
torrentFileName: 'bigBuckBunny.torrent'
},
{
testID: 'cosmos',
name: 'Cosmos Laundromat (Preview)',
posterFileName: 'cosmosLaundromat.jpg',
torrentFileName: 'cosmosLaundromat.torrent'
},
{
testID: 'sintel',
name: 'Sintel',
posterFileName: 'sintel.jpg',
torrentFileName: 'sintel.torrent'
},
{
testID: 'tears',
name: 'Tears of Steel',
posterFileName: 'tearsOfSteel.jpg',
torrentFileName: 'tearsOfSteel.torrent'
},
{
testID: 'wired',
name: 'The WIRED CD - Rip. Sample. Mash. Share.',
posterFileName: 'wiredCd.jpg',
torrentFileName: 'wiredCd.torrent'
@@ -111,7 +116,7 @@ function getPath (key) {
if (process.type === 'renderer') {
return electron.remote.app.getPath(key)
} else {
electron.app.getPath(key)
return electron.app.getPath(key)
}
}

View File

@@ -9,12 +9,12 @@ module.exports = class ModalOKCancel extends React.Component {
return (
<div className='float-right'>
<FlatButton
className='control'
className='control cancel'
style={cancelStyle}
label={cancelText}
onClick={onCancel} />
<RaisedButton
className='control'
className='control ok'
primary
label={okText}
onClick={onOK} />

View File

@@ -151,7 +151,8 @@ function setupSavedState (cb) {
torrentFileName: parsedTorrent.infoHash + '.torrent',
magnetURI: parseTorrent.toMagnetURI(parsedTorrent),
files: parsedTorrent.files,
selections: parsedTorrent.files.map((x) => true)
selections: parsedTorrent.files.map((x) => true),
testID: t.testID
}
}
}

View File

@@ -58,6 +58,7 @@ State.load(onState)
function onState (err, _state) {
if (err) return onError(err)
state = window.state = _state // Make available for easier debugging
window.dispatch = dispatch
telemetry.init(state)

View File

@@ -62,6 +62,7 @@ module.exports = class TorrentList extends React.Component {
if (!torrentSummary.torrentKey) throw new InvalidTorrentError('Missing torrentKey')
return (
<div
id={torrentSummary.testID && ('torrent-' + torrentSummary.testID)}
key={torrentSummary.torrentKey}
style={style}
className={classes.join(' ')}
@@ -346,7 +347,7 @@ module.exports = class TorrentList extends React.Component {
</td>
<td className='col-select'
onClick={dispatcher('toggleTorrentFile', infoHash, index)}>
<i className='icon'>{isSelected ? 'close' : 'add'}</i>
<i className='icon deselect-file'>{isSelected ? 'close' : 'add'}</i>
</td>
</tr>
)