Skip to content

Commit

Permalink
Add eh getImagesUrl tests
Browse files Browse the repository at this point in the history
  • Loading branch information
violet-dev committed Dec 31, 2024
1 parent 2b014d2 commit 03da942
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
15 changes: 15 additions & 0 deletions violet/test/component_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:violet/component/eh/eh_headers.dart';
import 'package:violet/component/eh/eh_parser.dart';
import 'package:violet/component/hentai.dart';
import 'package:violet/database/query.dart';
Expand Down Expand Up @@ -61,4 +62,18 @@ Page 20: 020.jpg" src="https://exhentai.org/t/66/55/6655fb520e13eff74ebf9aa49c21
final provider = await HentaiManager.getImageProvider(query);
expect(provider.length(), 25);
});

test('EHentai Parse Article Data', () async {
final html = await EHSession.requestString(
'https://exhentai.org/g/2504057/6757b3c4b8/');
final article = EHParser.parseArticleData(html);
expect(article.comment!.isNotEmpty, true);
});

test('EHentai Get Images Url', () async {
final html = await EHSession.requestString(
'https://exhentai.org/g/3176408/87646440e1/?p=0&inline_set=ts_m');
final urls = EHParser.getImagesUrl(html);
expect(urls.length, 20);
});
}
26 changes: 0 additions & 26 deletions violet/test/parse_test.dart

This file was deleted.

0 comments on commit 03da942

Please sign in to comment.