-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
pkgs/by-name/ma/manga-tui/0001-fix-remove-flaky-test.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
From 557e4230740d0f00f50946049378d16cc2954291 Mon Sep 17 00:00:00 2001 | ||
From: Youwen Wu <[email protected]> | ||
Date: Wed, 6 Nov 2024 02:11:30 -0800 | ||
Subject: [PATCH] fix: remove flaky test | ||
|
||
--- | ||
src/view/pages/manga.rs | 53 +++++++++++++++-------------------------- | ||
1 file changed, 19 insertions(+), 34 deletions(-) | ||
|
||
diff --git a/src/view/pages/manga.rs b/src/view/pages/manga.rs | ||
index 119d9ea..f49925c 100644 | ||
--- a/src/view/pages/manga.rs | ||
+++ b/src/view/pages/manga.rs | ||
@@ -404,10 +404,13 @@ impl MangaPage { | ||
let layout = Layout::horizontal([Constraint::Percentage(40), Constraint::Percentage(60)]); | ||
let [sorting_area, language_area] = layout.areas(area); | ||
|
||
- let order_title = format!("Order: {} ", match self.chapter_order { | ||
- ChapterOrder::Descending => "Descending", | ||
- ChapterOrder::Ascending => "Ascending", | ||
- }); | ||
+ let order_title = format!( | ||
+ "Order: {} ", | ||
+ match self.chapter_order { | ||
+ ChapterOrder::Descending => "Descending", | ||
+ ChapterOrder::Ascending => "Ascending", | ||
+ } | ||
+ ); | ||
|
||
Paragraph::new(Line::from(vec![ | ||
order_title.into(), | ||
@@ -981,15 +984,18 @@ impl MangaPage { | ||
|
||
let config = MangaTuiConfig::get(); | ||
|
||
- let download_all_chapters_process = download_all_chapters(api_client, DownloadAllChapters { | ||
- sender: tx.clone(), | ||
- manga_id, | ||
- manga_title, | ||
- image_quality: config.image_quality, | ||
- directory_to_download: AppDirectories::MangaDownloads.get_full_path(), | ||
- file_format: config.download_type, | ||
- language: lang, | ||
- }) | ||
+ let download_all_chapters_process = download_all_chapters( | ||
+ api_client, | ||
+ DownloadAllChapters { | ||
+ sender: tx.clone(), | ||
+ manga_id, | ||
+ manga_title, | ||
+ image_quality: config.image_quality, | ||
+ directory_to_download: AppDirectories::MangaDownloads.get_full_path(), | ||
+ file_format: config.download_type, | ||
+ language: lang, | ||
+ }, | ||
+ ) | ||
.await; | ||
|
||
if let Err(e) = download_all_chapters_process { | ||
@@ -1853,25 +1859,4 @@ mod test { | ||
assert_eq!(manga_page.bookmark_state.phase, BookmarkPhase::SearchingFromApi); | ||
assert_eq!(expected, result) | ||
} | ||
- | ||
- #[tokio::test] | ||
- async fn it_sends_event_chapter_bookmarked_failed_to_fetch() { | ||
- let (tx, _) = unbounded_channel(); | ||
- let mut manga_page = MangaPage::new(Manga::default(), None).with_global_sender(tx); | ||
- | ||
- flush_events(&mut manga_page); | ||
- | ||
- let api_client = TestApiClient::with_failing_response(); | ||
- | ||
- manga_page.fetch_chapter_bookmarked(ChapterBookmarked::default(), api_client); | ||
- | ||
- let expected = MangaPageEvents::FetchBookmarkFailed; | ||
- | ||
- let result = timeout(Duration::from_millis(250), manga_page.local_event_rx.recv()) | ||
- .await | ||
- .unwrap() | ||
- .unwrap(); | ||
- | ||
- assert_eq!(expected, result); | ||
- } | ||
} | ||
-- | ||
2.46.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters