Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3572)

Unified Diff: chrome/test/data/webui/md_history/history_grouped_list_test.js

Issue 2570253002: [MD History] Fix toolbar dates in grouped mode. (Closed)
Patch Set: use date interval format Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/md_history/history_grouped_list_test.js
diff --git a/chrome/test/data/webui/md_history/history_grouped_list_test.js b/chrome/test/data/webui/md_history/history_grouped_list_test.js
index 35e69e428090908fbbdc92342b5dc5a1c70cdef7..0928f9803dbb8eda24ac255159617b450b71d9b0 100644
--- a/chrome/test/data/webui/md_history/history_grouped_list_test.js
+++ b/chrome/test/data/webui/md_history/history_grouped_list_test.js
@@ -80,8 +80,6 @@ cr.define('md_history.history_grouped_list_test', function() {
test('items grouped by domain', function() {
app.set('queryState_.range', HistoryRange.WEEK);
var info = createHistoryInfo();
- info.queryStartTime = 'Yesterday';
- info.queryEndTime = 'Now';
app.historyResult(info, SIMPLE_RESULTS);
return PolymerTest.flushTasks().then(function() {
var data = groupedList.groupedHistoryData_;
@@ -93,13 +91,27 @@ cr.define('md_history.history_grouped_list_test', function() {
assertEquals(2, data[0].domains[0].visits.length);
assertEquals(1, data[0].domains[1].visits.length);
assertEquals(1, data[0].domains[2].visits.length);
-
- // Ensure the toolbar displays the correct begin and end time.
- assertEquals('Yesterday', toolbar.queryStartTime);
- assertEquals('Now', toolbar.queryEndTime);
});
});
+ test('toolbar dates appear in grouped mode', function() {
+ var getInfo = function() {
+ var info = createHistoryInfo();
+ info.queryStartMonth = 'Dec 2016';
+ info.queryInterval = 'Yesterday - Now';
+ return info;
+ };
+ app.set('queryState_.range', HistoryRange.MONTH);
+ app.historyResult(getInfo(), SIMPLE_RESULTS);
+ assertEquals(
+ 'Dec 2016', toolbar.$$('#grouped-date').textContent.trim());
+
+ app.set('queryState_.range', HistoryRange.WEEK);
+ app.historyResult(getInfo(), SIMPLE_RESULTS);
+ assertEquals(
+ 'Yesterday - Now', toolbar.$$('#grouped-date').textContent.trim());
+ });
+
test('items grouped by day in week view', function() {
app.set('queryState_.range', HistoryRange.WEEK);
app.historyResult(createHistoryInfo(), PER_DAY_RESULTS);

Powered by Google App Engine
This is Rietveld 408576698