mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1107210 - Fixed room name update not correctly reflected in Loop panel. r=Standard8
This commit is contained in:
parent
f435f64942
commit
79e9a5b3bb
@ -537,6 +537,12 @@ loop.panel = (function(_, mozL10n) {
|
||||
return {edit: false, text: this.props.text};
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(nextProps) {
|
||||
if (nextProps.text !== this.props.text) {
|
||||
this.setState({text: nextProps.text});
|
||||
}
|
||||
},
|
||||
|
||||
handleTextClick: function(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
@ -537,6 +537,12 @@ loop.panel = (function(_, mozL10n) {
|
||||
return {edit: false, text: this.props.text};
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(nextProps) {
|
||||
if (nextProps.text !== this.props.text) {
|
||||
this.setState({text: nextProps.text});
|
||||
}
|
||||
},
|
||||
|
||||
handleTextClick: function(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
@ -391,8 +391,7 @@ loop.store.ActiveRoomStore = (function() {
|
||||
this._leaveRoom(ROOM_STATES.CLOSING);
|
||||
|
||||
// If we're closing the window, we can stop listening to updates.
|
||||
this._mozLoop.rooms.off("update:" + this.getStoreState().roomToken,
|
||||
this._handleRoomUpdate.bind(this));
|
||||
this._mozLoop.rooms.off("update:" + this.getStoreState().roomToken);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -857,6 +857,25 @@ describe("loop.panel", function() {
|
||||
new sharedActions.OpenRoom({roomToken: roomData.roomToken}));
|
||||
});
|
||||
});
|
||||
|
||||
describe("Room name updated", function() {
|
||||
it("should update room name", function() {
|
||||
var roomEntry = mountRoomEntry({
|
||||
dispatcher: dispatcher,
|
||||
room: new loop.store.Room(roomData)
|
||||
});
|
||||
var updatedRoom = new loop.store.Room(_.extend({}, roomData, {
|
||||
roomName: "New room name",
|
||||
ctime: new Date().getTime()
|
||||
}));
|
||||
|
||||
roomEntry.setProps({room: updatedRoom});
|
||||
|
||||
expect(
|
||||
roomEntry.getDOMNode().querySelector(".edit-in-place").textContent)
|
||||
.eql("New room name");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("loop.panel.RoomList", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user