提交 1506c5ee 编写于 作者: B Benjamin Pasero

grid - add tests for recently active groups

上级 70c34cd7
......@@ -271,14 +271,14 @@ export interface IEditorOptions {
/**
* Will reveal the editor if it is already opened and visible in any of the opened editor groups. Note
* that this option is just a hint that might be ignored if the user wants to open an editor explicitly
* to the side of another one.
* to the side of another one or into a specific editor group.
*/
readonly revealIfVisible?: boolean;
/**
* Will reveal the editor if it is already opened (even when not visible) in any of the opened editor groups. Note
* that this option is just a hint that might be ignored if the user wants to open an editor explicitly
* to the side of another one.
* to the side of another one or into a specific editor group.
*/
readonly revealIfOpened?: boolean;
......
......@@ -87,7 +87,7 @@ export class NextEditorService implements INextEditorService {
}
// Group: Specific Group
if (typeof group === 'number') {
else if (typeof group === 'number') {
targetGroup = this.nextEditorGroupsService.getGroup(group);
}
......
......@@ -30,29 +30,58 @@ suite('editor2 tests', () => {
assert.equal(part.groups.length, 1);
assert.ok(rootGroup.isActive);
let mru = part.getGroups(true);
assert.equal(mru.length, 1);
assert.equal(mru[0], rootGroup);
const rightGroup = part.addGroup(rootGroup, Direction.RIGHT);
assert.equal(part.groups.length, 2);
assert.ok(rootGroup.isActive);
mru = part.getGroups(true);
assert.equal(mru.length, 2);
assert.equal(mru[0], rootGroup);
assert.equal(mru[1], rightGroup);
assert.equal(activeGroupChangeCounter, 0);
part.activateGroup(rightGroup);
assert.ok(rightGroup.isActive);
assert.equal(activeGroupChangeCounter, 1);
mru = part.getGroups(true);
assert.equal(mru.length, 2);
assert.equal(mru[0], rightGroup);
assert.equal(mru[1], rootGroup);
const downGroup = part.addGroup(rightGroup, Direction.DOWN);
assert.equal(part.groups.length, 3);
assert.ok(rightGroup.isActive);
assert.ok(!downGroup.activeControl);
mru = part.getGroups(true);
assert.equal(mru.length, 3);
assert.equal(mru[0], rightGroup);
assert.equal(mru[1], rootGroup);
assert.equal(mru[2], downGroup);
part.removeGroup(downGroup);
assert.equal(part.groups.length, 2);
assert.ok(rightGroup.isActive);
mru = part.getGroups(true);
assert.equal(mru.length, 2);
assert.equal(mru[0], rightGroup);
assert.equal(mru[1], rootGroup);
part.removeGroup(rightGroup);
assert.equal(part.groups.length, 1);
assert.ok(rootGroup.isActive);
mru = part.getGroups(true);
assert.equal(mru.length, 1);
assert.equal(mru[0], rootGroup);
part.removeGroup(rootGroup); // cannot remove root group
assert.equal(part.groups.length, 1);
assert.ok(rootGroup.isActive);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册