Collapsible Room List - Clicking on separator should expand to last set width (#32909)
* Expand panel to last known width * Update test
This commit is contained in:
@@ -75,7 +75,8 @@ export class ResizerViewModel
|
||||
|
||||
public onSeparatorClick = (): void => {
|
||||
if (this.panelHandle?.isCollapsed()) {
|
||||
this.panelHandle.resize(`100%`);
|
||||
const lastSize = SettingsStore.getValue("RoomList.panelSize");
|
||||
this.panelHandle.resize(`${lastSize}%`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ describe("LeftPanelResizerViewModel", () => {
|
||||
|
||||
it("should expand panel on onSeparatorClick()", () => {
|
||||
const vm = new ResizerViewModel();
|
||||
SettingsStore.setValue("RoomList.panelSize", null, SettingLevel.DEVICE, 34);
|
||||
const mockHandle = {
|
||||
resize: jest.fn(),
|
||||
isCollapsed: jest.fn().mockReturnValue(true),
|
||||
@@ -78,7 +79,7 @@ describe("LeftPanelResizerViewModel", () => {
|
||||
|
||||
vm.onSeparatorClick();
|
||||
|
||||
expect(mockHandle.resize).toHaveBeenCalledWith("100%");
|
||||
expect(mockHandle.resize).toHaveBeenCalledWith("34%");
|
||||
});
|
||||
|
||||
it("should set isFocusedViaKeyboard state correctly", () => {
|
||||
|
||||
Reference in New Issue
Block a user