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

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

Issue 466783002: Hide last updated data until date is populated. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
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 b4aaec06dbdfbe6c569a87fe3679acd3f2623baa..e5920cd4d53ec57a8a5b8f6ee116a62a27eed89d 100644
--- a/Tools/GardeningServer/ui/test/ct-last-updated-tests.html
+++ b/Tools/GardeningServer/ui/test/ct-last-updated-tests.html
@@ -14,20 +14,32 @@ var expect = chai.expect;
describe('ct-last-updated', function() {
var builder;
- beforeEach(function(done) {
- builder = document.createElement('ct-last-updated');
- // Set the date to 5 minutes ago.
- builder.date = new Date(Date.now() - (5 * 60 * 1000));
- requestAnimationFrame(function() { done(); });
- });
+ describe('Updated 5 minutes ago', function() {
+ beforeEach(function(done) {
+ builder = document.createElement('ct-last-updated');
ojan 2014/08/12 17:39:05 s/builder/lastUpdated
teravest 2014/08/12 19:31:41 Done.
+ // Set the date to 5 minutes ago.
+ builder.date = new Date(Date.now() - (5 * 60 * 1000));
+ requestAnimationFrame(function() { done(); });
+ });
- describe('default UI', function() {
it('should have correct text', function() {
var expected = 'Updated 5 min ago @ ' + builder.date.getHours() + ':' +
builder.date.getMinutes();
- expect(builder.shadowRoot.innerHTML.trim()).to.equal(expected);
+ expect(builder.shadowRoot.querySelector('span').innerHTML.trim()).to.equal(expected);
});
});
+
+ describe('No updated data', function() {
+ beforeEach(function(done) {
+ builder = document.createElement('ct-last-updated');
ojan 2014/08/12 17:39:05 s/builder/lastUpdated
teravest 2014/08/12 19:31:41 Done.
+ requestAnimationFrame(function() { done(); });
+ });
+
+ it('should have correct text', function() {
+ expect(builder.shadowRoot.querySelector('span').hasAttribute("hidden"));
+ });
+ });
+
});
})()

Powered by Google App Engine
This is Rietveld 408576698