Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #18255 from evanxd/bug-988516
Browse files Browse the repository at this point in the history
Bug 988516 - [Calendar] Intermittent failing test, day view events longer than 2h click after first hour
  • Loading branch information
KevinGrandon committed Apr 13, 2014
2 parents 68d8e68 + de84bf5 commit 28933e6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apps/calendar/test/marionette/day_view_test.js
Expand Up @@ -31,15 +31,12 @@ marionette('day view', function() {
app.day.waitForDisplay();
});

// disabled bug 988516
test.skip('click after first hour', function() {
// click will happen at middle of element and middle is after first hour,
// so this should be enough to trigger the event details (Bug 972666)
test('click after first hour', function() {
app.day.events[0].click();
app.readEvent.waitForDisplay();

assert.equal(
app.readEvent.title,
app.readEvent.waitForTextNotEmpty('title'),
'Lorem Ipsum',
'title should match'
);
Expand Down
16 changes: 16 additions & 0 deletions apps/calendar/test/marionette/lib/views/view.js
Expand Up @@ -49,6 +49,22 @@ View.prototype = {
}.bind(this));
},

/**
* Wait for the element's text in the getter is not empty,
* and then return the text.
*
* @param {String} getter id.
* @return {String} element's text.
*/
waitForTextNotEmpty: function(getter) {
var text;
this.client.waitFor(function() {
text = this[getter];
return text !== '';
}.bind(this));
return text;
},

/* Form helpers */

setFormValue: function(name, value) {
Expand Down

0 comments on commit 28933e6

Please sign in to comment.