mirror of
https://github.com/mathuo/dockview
synced 2025-08-12 12:16:01 +00:00
fix: tests
This commit is contained in:
parent
ccd8e7fdf5
commit
850ce4f0aa
@ -16,12 +16,12 @@ import { fireEvent } from '@testing-library/dom';
|
||||
import { LocalSelectionTransfer } from '../../dnd/dataTransfer';
|
||||
import { Position } from '../../dnd/droptarget';
|
||||
import { GroupviewPanel } from '../../groupview/groupviewPanel';
|
||||
import { GroupOptions, GroupDropEvent } from '../../groupview/groupview';
|
||||
import { DockviewPanelApi } from '../../api/groupPanelApi';
|
||||
import {
|
||||
DefaultGroupPanelView,
|
||||
IGroupPanelView,
|
||||
} from '../../react/dockview/v2/defaultGroupPanelView';
|
||||
import { GroupOptions, GroupDropEvent } from '../../groupview/groupview';
|
||||
import { DockviewPanelApi } from '../../api/groupPanelApi';
|
||||
} from '../../dockview/defaultGroupPanelView';
|
||||
|
||||
class Watermark implements IWatermarkRenderer {
|
||||
public readonly element = document.createElement('div');
|
||||
@ -137,6 +137,14 @@ class TestPanel implements IGroupPanel {
|
||||
private _onDidChangeState = new Emitter<void>();
|
||||
readonly onDidStateChange = this._onDidChangeState.event;
|
||||
|
||||
get title() {
|
||||
return '';
|
||||
}
|
||||
|
||||
get suppressClosable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
get group() {
|
||||
return this._group;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
import { GroupviewPanel } from '../../../groupview/groupviewPanel';
|
||||
import { CompositeDisposable } from '../../../lifecycle';
|
||||
import { PanelUpdateEvent } from '../../../panel/types';
|
||||
import { IGroupPanelView } from '../../../react/dockview/v2/defaultGroupPanelView';
|
||||
import { IGroupPanelView } from '../../../dockview/defaultGroupPanelView';
|
||||
|
||||
class TestContentRenderer
|
||||
extends CompositeDisposable
|
||||
|
@ -104,17 +104,19 @@ export class DockviewGroupPanel
|
||||
public toJSON(): GroupviewPanelState {
|
||||
const state = this.api.getState();
|
||||
|
||||
return {
|
||||
const objectState: GroupviewPanelState = {
|
||||
id: this.id,
|
||||
view: this.view!.toJSON(),
|
||||
params:
|
||||
Object.keys(this._params || {}).length > 0
|
||||
? this._params
|
||||
: undefined,
|
||||
title: this._params?.title as string,
|
||||
suppressClosable: this._params?.suppressClosable,
|
||||
state: state && Object.keys(state).length > 0 ? state : undefined,
|
||||
suppressClosable: this.suppressClosable || undefined,
|
||||
title: this.title,
|
||||
};
|
||||
|
||||
return objectState;
|
||||
}
|
||||
|
||||
public update(event: GroupPanelUpdateEvent): void {
|
||||
|
Loading…
x
Reference in New Issue
Block a user