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

Unified Diff: Tools/GardeningServer/ui/test/ct-last-updated-tests.html

Issue 473433002: Fix test for "last updated" text. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add extra test, remove syntax error fix Created 6 years, 4 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
« no previous file with comments | « Tools/GardeningServer/ui/ct-last-updated.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/ui/test/ct-last-updated-tests.html
diff --git a/Tools/GardeningServer/ui/test/ct-last-updated-tests.html b/Tools/GardeningServer/ui/test/ct-last-updated-tests.html
index 8f56d90d5b0b53f77802d4642063cab0d929336a..ff874359e681e573934157bd2b7ba651fcdb231b 100644
--- a/Tools/GardeningServer/ui/test/ct-last-updated-tests.html
+++ b/Tools/GardeningServer/ui/test/ct-last-updated-tests.html
@@ -24,7 +24,7 @@ describe('ct-last-updated', function() {
it('should have correct text', function() {
var expected = 'Updated 5 min ago @ ' + lastUpdated.date.getHours() + ':' +
- lastUpdated.date.getMinutes();
+ lastUpdated.date.getMinutes().toString().padLeft(2, '0');
assert.include(lastUpdated.shadowRoot.innerHTML.trim(), expected);
});
});
@@ -43,7 +43,6 @@ describe('ct-last-updated', function() {
describe('Pad minutes when less than 10', function() {
beforeEach(function(done) {
lastUpdated = document.createElement('ct-last-updated');
- // Set the date to 5 minutes ago.
lastUpdated.date = Date.create('11:05');
requestAnimationFrame(function() { done(); });
});
@@ -54,6 +53,20 @@ describe('ct-last-updated', function() {
});
});
+ describe('Pad minutes when greater than 10', function() {
+ beforeEach(function(done) {
+ lastUpdated = document.createElement('ct-last-updated');
+ lastUpdated.date = Date.create('11:25');
+ requestAnimationFrame(function() { done(); });
+ });
+
+ it('should have correct text', function() {
+ var expected = '11:25';
+ assert.include(lastUpdated.shadowRoot.innerHTML.trim(), expected);
+ });
+ });
+
+
});
})()
« no previous file with comments | « Tools/GardeningServer/ui/ct-last-updated.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698