Bug 1210707 - Feedback view no longer allows closing the window and avoiding leaving feedback. r=mikedeboer

This commit is contained in:
Mark Banner 2015-10-05 14:40:15 +01:00
parent 43214fca95
commit 366a15220e
2 changed files with 15 additions and 1 deletions

View File

@ -147,7 +147,8 @@ loop.store.ConversationAppStore = (function() {
this._dispatcher.dispatch(new loop.shared.actions.HangupCall());
break;
case "room":
if (this._activeRoomStore.getStoreState().used) {
if (this._activeRoomStore.getStoreState().used &&
!this._storeState.showFeedbackForm) {
this._dispatcher.dispatch(new loop.shared.actions.LeaveRoom());
} else {
loop.shared.mixins.WindowCloseMixin.closeWindow();

View File

@ -250,6 +250,19 @@ describe("loop.store.ConversationAppStore", function () {
sinon.assert.notCalled(loop.shared.mixins.WindowCloseMixin.closeWindow);
});
it("should close the window when a room was used and it showed feedback", function() {
store.setStoreState({
showFeedbackForm: true,
windowType: "room"
});
roomUsed = true;
store.LoopHangupNowHandler();
sinon.assert.notCalled(dispatcher.dispatch);
sinon.assert.calledOnce(loop.shared.mixins.WindowCloseMixin.closeWindow);
});
it("should close the window when a room was not used", function() {
store.setStoreState({ windowType: "room" });