Skip to content

Commit

Permalink
feat(test): details test
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Feb 16, 2021
1 parent 49f3beb commit d02592e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/torrent-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,15 @@ const TorrentInformation = (props) => {
<ListItem
// leftAvatar={<Avatar icon={<EditorInsertChart />} backgroundColor={yellow600} />}
rightIcon={<ActionInfo />}
id="torrentSizeId"
primaryText={__('Torrent Size')}
secondaryText={formatBytes(torrent.size)}
/>
<ListItem
// leftAvatar={<Avatar icon={<EditorInsertChart />} backgroundColor={yellow600} />}
rightIcon={<ActionInfo />}
primaryText={__('Torrent contains files')}
id="torrentFilesId"
secondaryText={torrent.files}
onClick={() => {
if(!props.parent)
Expand Down Expand Up @@ -463,7 +465,7 @@ export default class TorrentPage extends Page {
e.preventDefault();
}}
icon={
<svg viewBox="0 0 56 56" fill='white'>
<svg viewBox="0 0 56 56" fill='white' id="downloadSvg">
<g>
<path d="M35.586,41.586L31,46.172V28c0-1.104-0.896-2-2-2s-2,0.896-2,2v18.172l-4.586-4.586c-0.781-0.781-2.047-0.781-2.828,0
s-0.781,2.047,0,2.828l7.999,7.999c0.093,0.094,0.196,0.177,0.307,0.251c0.047,0.032,0.099,0.053,0.148,0.081
Expand Down
27 changes: 27 additions & 0 deletions tests/details.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { assert, expect } from "chai";
const asyncWait = require('../src/background/asyncWait')
const md5 = require('md5-file')
const config = require('../src/background/config')
const fs = require('fs')

describe("details", function() {
this.timeout(30000);


it("open details", async function() {
const { app } = this
await (await app.client.$('#searchInput')).setValue('433DF14A5573C0F41E59618FF4C832B835A66F75')
await (await app.client.$('#search')).click()
await (await app.client.$('.torrentRow')).click()
await (await app.client.$('.info-table')).isExisting()
})

it("details colums", async function() {
const { app } = this
const size = await (await app.client.$('#torrentSizeId')).getText();
assert(size.includes('22.291'))
const files = await (await app.client.$('#torrentFilesId')).getText();
assert(files.includes('6'))
})

});

0 comments on commit d02592e

Please sign in to comment.