Skip to content

Commit f5906a8

Browse files
committed
test: test case for renderPane
1 parent 3317dba commit f5906a8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/controller/__tests__/editor.test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { container } from 'tsyringe';
33
import { EditorService, StatusBarService, BuiltinService } from 'mo/services';
44
import { EditorController } from '../editor';
55
import { editor as MonacoEditor, IDisposable, Position } from 'mo/monaco';
6+
import { IEditorTab } from 'mo/model';
67

78
const editorController = container.resolve(EditorController);
89
const editorService = container.resolve(EditorService);
@@ -35,10 +36,14 @@ describe('The ediotr controller', () => {
3536
return {} as IDisposable;
3637
});
3738
editorInstance.getPosition = jest.fn(() => position);
38-
39-
const testTab = {
40-
id: 'testTab',
41-
name: 'testTab',
39+
const tabName = 'testTab';
40+
const testTab: IEditorTab = {
41+
id: tabName,
42+
name: tabName,
43+
renderPane: (tabData, tab, group) => {
44+
expect(tab?.id).toEqual(tabName);
45+
return;
46+
},
4247
};
4348
editorService.open(testTab);
4449
const { current } = editorService.getState();

0 commit comments

Comments
 (0)