Skip to content

Commit

Permalink
Fix tests creating FeedItems just once because of duplicate IDs (#7148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteHamster committed Apr 28, 2024
1 parent 3581787 commit 257c3bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -66,7 +66,7 @@ public void testMarkAsPlayedList() throws Exception {
onDrawerItem(withText(feed.getTitle())).perform(click());
onView(withText(feed.getItemAtIndex(0).getTitle())).perform(click());
onView(isRoot()).perform(waitForView(withText(R.string.mark_read_no_media_label), 3000));
onView(withText(R.string.mark_read_no_media_label)).perform(click());
onView(allOf(withText(R.string.mark_read_no_media_label), isDisplayed())).perform(click());
onView(isRoot()).perform(waitForView(allOf(withText(R.string.mark_read_no_media_label), not(isDisplayed())), 3000));
}

Expand Down
Expand Up @@ -128,13 +128,13 @@ public void addHostedFeedData() throws IOException {
// create items
List<FeedItem> items = new ArrayList<>();
for (int j = 0; j < NUM_ITEMS_PER_FEED; j++) {
FeedItem item = new FeedItem(j, "Feed " + (i+1) + ": Item " + (j+1), "item" + j,
FeedItem item = new FeedItem(0, "Feed " + (i+1) + ": Item " + (j+1), "item" + j,
"http://example.com/feed" + i + "/item/" + j, new Date(), FeedItem.UNPLAYED, feed);
items.add(item);

if (!hostTextOnlyFeeds) {
File mediaFile = newMediaFile("feed-" + i + "-episode-" + j + ".mp3");
item.setMedia(new FeedMedia(j, item, 0, 0, mediaFile.length(), "audio/mp3", null, hostFile(mediaFile), false, null, 0, 0));
item.setMedia(new FeedMedia(0, item, 0, 0, mediaFile.length(), "audio/mp3", null, hostFile(mediaFile), false, null, 0, 0));
}
}
feed.setItems(items);
Expand Down

0 comments on commit 257c3bc

Please sign in to comment.