VRFS-2095 fix tests

This commit is contained in:
Brian Smith 2014-08-29 09:17:22 -04:00
parent d6fc76728f
commit 860d76db86
3 changed files with 12 additions and 11 deletions

View File

@ -26,7 +26,6 @@
var $ssNext = null;
var $ssScroller = null;
var $ssNoMoreEntries = null;
var $ssSpinner = null;
var currentScheduledSessionsPage = 0;
var currentScheduledSessionsQuery = defaultScheduledSessionsQuery();
@ -138,11 +137,9 @@
var $noSessionsMsgSelector = $('#no-active-sessions');
if (sessionList.length === 0) {
$(CATEGORY.ACTIVE.id).hide();
$noSessionsMsgSelector.show();
}
else {
$(CATEGORY.ACTIVE.id).show();
$noSessionsMsgSelector.hide();
}
@ -202,13 +199,16 @@
function afterLoadScheduledSessions(sessionList) {
var $noSessionsMsgSelector = $('#no-scheduled-sessions');
if(sessionList.length < SCHEDULED_SESSIONS_LIMIT) {
// if we retrieve less results than asked for, end searching
$ssScroller.infinitescroll('pause');
$ssNoMoreEntries.show();
$noSessionsMsgSelector.show();
$('.infinite-scroll-loader').remove();
}
else {
// $noSessionsMsgSelector.hide();
currentScheduledSessionsPage++;
buildScheduledSessionsQuery();
registerScheduledSessionInfiniteScroll();
@ -264,7 +264,9 @@
currentScheduledSessionsPage = 0;
$ssScroller.infinitescroll('resume');
$('table#sessions-scheduled').find("tr:gt(0)").remove();
$ssNoMoreEntries.hide();
$('#no-active-sessions').hide();
// $('#no-scheduled-sessions').hide();
}
function events() {
@ -296,7 +298,6 @@
$screen = $('#findSession');
$ssNext = $screen.find('#sessions-scheduled .btn-next')
$ssScroller = $screen.find('.content-body-scroller');
$ssNoMoreEntries = $screen.find('#end-of-ss-list');
$ssSpinner = $screen.find('#sessions-scheduled .paginate-wait');
$asSpinner = $screen.find('#sessions-active .paginate-wait');

View File

@ -52,8 +52,8 @@
<%= render :partial => "sessionList", :locals => {:title => "current, active sessions", :category => "sessions-active"} %>
<br />
<div class="paginate-wait">Fetching results...<div class="spinner-small"></div></div>
<div id="no-active-sessions">
No more active public sessions found.
<div id="no-active-sessions" class="end-of-list">
End of list.
</div>
</div>
<br />
@ -61,8 +61,8 @@
<%= render :partial => "sessionList", :locals => {:title => "future, scheduled sessions", :category => "sessions-scheduled"} %>
<br />
<div class="paginate-wait">Fetching results...<div class="spinner-small"></div></div>
<div id="end-of-ss-list" class="end-of-list">
No more scheduled sessions.
<div id="no-scheduled-sessions" class="end-of-list">
End of list.
</div>
<span class="btn-next-wrapper"><a href="/api/sessions/inactive?page=1" class="btn-next">Next</a></span>
</div>

View File

@ -113,7 +113,7 @@ describe "Find Session", :js => true, :type => :feature, :capybara_feature => tr
page.assert_selector('div#sessions-scheduled .found-session', count: 20)
page.execute_script('jQuery("#findSession .content-body-scroller").scrollTo("100%",100)') #scroll to the bottom of the element
find('#end-of-ss-list')
find('#no-scheduled-sessions')
page.assert_selector('div#sessions-scheduled .found-session', count: 21)
end
end