Integration test: delete torrent + data

This commit is contained in:
DC
2016-09-08 23:56:59 -07:00
parent a4c715e3f6
commit 290913d07a
4 changed files with 24 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ const test = require('tape')
const fs = require('fs-extra')
const setup = require('./setup')
test.skip('torrent-list: show download path missing', function (t) {
test('torrent-list: show download path missing', function (t) {
setup.wipeTestDataDir()
fs.removeSync(setup.TEST_DOWNLOAD_DIR)
@@ -23,7 +23,7 @@ test.skip('torrent-list: show download path missing', function (t) {
(err) => setup.endTest(app, t, err || 'error'))
})
test.skip('torrent-list: start, stop, and delete torrents', function (t) {
test('torrent-list: start, stop, and delete torrents', function (t) {
setup.wipeTestDataDir()
const app = setup.createApp()
@@ -81,7 +81,7 @@ test('torrent-list: expand torrent, unselect file', function (t) {
.then(() => setup.screenshotCreateOrCompare(app, t, 'torrent-list-cosmos-expand-deselect'))
// Start the torrent
.then(() => app.client.click('#torrent-cosmos .icon.download'))
.then(() => app.client.waitUntilTextExists('.torrent-list', '0%'))
.then(() => app.client.waitUntilTextExists('.torrent-list', 'peers'))
.then(() => setup.screenshotCreateOrCompare(app, t, 'torrent-list-cosmos-expand-start'))
// Make sure that it creates all files EXCEPT the deslected one
.then(() => setup.compareDownloadFolder(t, 'CosmosLaundromatFirstCycle', [
@@ -97,6 +97,16 @@ test('torrent-list: expand torrent, unselect file', function (t) {
'CosmosLaundromatFirstCycle_meta.sqlite',
'CosmosLaundromatFirstCycle_meta.xml'
]))
// Delete torrent plus data
// Spectron doesn't have proper support for menu clicks yet...
.then(() => app.webContents.executeJavaScript(
'dispatch("confirmDeleteTorrent", "6a02592d2bbc069628cd5ed8a54f88ee06ac0ba5", true)'))
.then(() => setup.wait())
.then(() => setup.screenshotCreateOrCompare(app, t, 'torrent-list-cosmos-delete-data'))
// Click confirm
.then(() => app.client.click('.control.ok'))
.then(() => setup.wait())
.then(() => setup.screenshotCreateOrCompare(app, t, 'torrent-list-cosmos-deleted'))
// Make sure that all the files are gone
.then(() => setup.compareDownloadFolder(t, 'CosmosLaundromatFirstCycle', null))
.then(() => setup.endTest(app, t),