Example #1
0
	test('get next element to focus after removing a match when it is the only match', function () {
		const fileMatch1 = aFileMatch();
		const data = [fileMatch1, aMatch(fileMatch1)];
		const tree = aTree(data);
		const target = data[1];
		const testObject: ReplaceAction = instantiationService.createInstance(ReplaceAction, tree, target, null);

		const actual = testObject.getElementToFocusAfterRemoved(tree, target);
		assert.equal(undefined, actual);
	});
Example #2
0
	test('get next element to focus after removing a match when it does not have next sibling match and previous match is file match', function () {
		const fileMatch1 = aFileMatch();
		const fileMatch2 = aFileMatch();
		const data = [fileMatch1, aMatch(fileMatch1), aMatch(fileMatch1), fileMatch2, aMatch(fileMatch2)];
		const tree = aTree(data);
		const target = data[4];
		const testObject: ReplaceAction = instantiationService.createInstance(ReplaceAction, tree, target, null);

		const actual = testObject.getElementToFocusAfterRemoved(tree, target);
		assert.equal(data[2], actual);
	});