feat(test): details test
This commit is contained in:
@ -165,6 +165,7 @@ const TorrentInformation = (props) => {
|
|||||||
<ListItem
|
<ListItem
|
||||||
// leftAvatar={<Avatar icon={<EditorInsertChart />} backgroundColor={yellow600} />}
|
// leftAvatar={<Avatar icon={<EditorInsertChart />} backgroundColor={yellow600} />}
|
||||||
rightIcon={<ActionInfo />}
|
rightIcon={<ActionInfo />}
|
||||||
|
id="torrentSizeId"
|
||||||
primaryText={__('Torrent Size')}
|
primaryText={__('Torrent Size')}
|
||||||
secondaryText={formatBytes(torrent.size)}
|
secondaryText={formatBytes(torrent.size)}
|
||||||
/>
|
/>
|
||||||
@ -172,6 +173,7 @@ const TorrentInformation = (props) => {
|
|||||||
// leftAvatar={<Avatar icon={<EditorInsertChart />} backgroundColor={yellow600} />}
|
// leftAvatar={<Avatar icon={<EditorInsertChart />} backgroundColor={yellow600} />}
|
||||||
rightIcon={<ActionInfo />}
|
rightIcon={<ActionInfo />}
|
||||||
primaryText={__('Torrent contains files')}
|
primaryText={__('Torrent contains files')}
|
||||||
|
id="torrentFilesId"
|
||||||
secondaryText={torrent.files}
|
secondaryText={torrent.files}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if(!props.parent)
|
if(!props.parent)
|
||||||
@ -463,7 +465,7 @@ export default class TorrentPage extends Page {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}}
|
}}
|
||||||
icon={
|
icon={
|
||||||
<svg viewBox="0 0 56 56" fill='white'>
|
<svg viewBox="0 0 56 56" fill='white' id="downloadSvg">
|
||||||
<g>
|
<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
|
<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
|
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
|
||||||
|
27
tests/details.test.js
Normal file
27
tests/details.test.js
Normal file
@ -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'))
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
Reference in New Issue
Block a user