VRFS-2739 - remove aggressive check for bad session info and add some basic tests to catch errors in the future
This commit is contained in:
parent
413bea651b
commit
768c9e2024
|
|
@ -221,9 +221,9 @@
|
|||
$.each(response, function(index, val) {
|
||||
|
||||
// this means the session no longer exists
|
||||
if (response.fan_access == null && response.musician_access == null) {
|
||||
return;
|
||||
}
|
||||
//if (response.fan_access == null && response.musician_access == null) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
if(val.description == context.JK.MessageType.TEXT_MESSAGE) {
|
||||
val.formatted_msg = textMessageDialog.formatTextMessage(val.message.substring(0, 200), val.source_user_id, val.source_user.name, val.message.length > 200).html();
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@
|
|||
|
||||
<!-- Notification panel template -->
|
||||
<script type="text/template" id="template-notification-panel">
|
||||
<li session-id="{sessionId}" notification-id="{notificationId}">
|
||||
<li class="notification-entry" session-id="{sessionId}" notification-id="{notificationId}">
|
||||
<div class="avatar-small" user-id="{userId}" hoveraction="musician"><img src="{avatar_url}" /></div>
|
||||
<div session-id="{sessionId}" hoveraction="hoveraction" class="note-text">
|
||||
{text}<br/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "Notification Subpanel", :js => true, :type => :feature, :capybara_feature => true do
|
||||
|
||||
subject { page }
|
||||
|
||||
|
||||
let(:user) { FactoryGirl.create(:user, last_jam_locidispid: 1) }
|
||||
|
||||
|
||||
|
||||
describe "user with no notifications" do
|
||||
before(:each) do
|
||||
fast_signin(user, "/client")
|
||||
end
|
||||
|
||||
it "lists no notifications" do
|
||||
open_notifications
|
||||
expect(page).to have_selector("#{NOTIFICATION_PANEL} li.notification-entry", count: 0)
|
||||
end
|
||||
end
|
||||
|
||||
describe "user with 1 notification" do
|
||||
|
||||
let!(:other) { FactoryGirl.create(:user, last_jam_locidispid: 1) }
|
||||
let!(:msg1) {FactoryGirl.create(:notification_text_message, source_user: other, target_user: user) }
|
||||
|
||||
before(:each) do
|
||||
fast_signin(user, "/client")
|
||||
|
||||
end
|
||||
|
||||
it "lists 1 notifications" do
|
||||
open_notifications
|
||||
expect(page).to have_selector("#{NOTIFICATION_PANEL} li.notification-entry", count: 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue