[results feed][testing] Fix test broken by adding anchors to all commits
TBR: athom@google.com
Change-Id: I5b5583fd3cc0b1d08ea1f0787e979a98270501d3
Reviewed-on: https://dart-review.googlesource.com/c/dart_ci/+/129882
Reviewed-by: William Hesse <whesse@google.com>
diff --git a/results_feed/test/comments_test.dart b/results_feed/test/comments_test.dart
index c9048b6..31a70f2 100644
--- a/results_feed/test/comments_test.dart
+++ b/results_feed/test/comments_test.dart
@@ -123,6 +123,7 @@
// Take commit with a non-trival buildlist, press button on it.
final unpinned = app.commits
.where((commit) =>
+ commit.isNotEmpty &&
commit.blamelist.commentBodies.isNotEmpty &&
commit.blamelist.firstCommit != commit.blamelist.lastCommit)
.single;
@@ -132,7 +133,8 @@
// DOM has changed.
app = AppPO.create(context);
final commits = app.commits
- .where((commit) => commit.blamelist.commentBodies.isNotEmpty)
+ .where((commit) =>
+ commit.isNotEmpty && commit.blamelist.commentBodies.isNotEmpty)
.toList();
final data = commentsSampleData;
diff --git a/results_feed/test/page_objects/commit_po.dart b/results_feed/test/page_objects/commit_po.dart
index d9b8254..c26fcc6 100644
--- a/results_feed/test/page_objects/commit_po.dart
+++ b/results_feed/test/page_objects/commit_po.dart
@@ -13,6 +13,12 @@
CommitPO();
factory CommitPO.create(PageLoaderElement context) = $CommitPO.create;
+ @First(ByCss('div.commit'))
+ PageLoaderElement get _commit;
+
+ bool get isNotEmpty => _commit.exists;
+ bool get isEmpty => !isNotEmpty;
+
@First(ByTagName('blamelist-panel'))
PageLoaderElement get _blamelistPanel;