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
Родитель 15c18ce28f
Коммит 45b716e162
2 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -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();

Просмотреть файл

@ -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" });