Fix opening of links in new tab using ctrl.

pull/2887/head
mhirtie 10 years ago committed by Alex Coles
parent 20ba2ea8ac
commit 62fda9af27
  1. 1
      frontend/.jshintrc
  2. 2
      frontend/app/work_packages/directives/work-packages-table-directive.js
  3. 29
      frontend/tests/integration/specs/work-packages/work-packages-spec.js

@ -10,6 +10,7 @@
"angular", "angular",
"inject", "inject",
"module", "module",
"protractor",
"I18n", "I18n",
"Hyperagent", "Hyperagent",

@ -215,6 +215,8 @@ module.exports = function(I18n, WorkPackagesTableService, $window, $timeout, fla
if ($event.shiftKey) { if ($event.shiftKey) {
clearSelection(); clearSelection();
activeSelectionBorderIndex = WorkPackagesTableService.selectRowRange(scope.rows, row, activeSelectionBorderIndex); activeSelectionBorderIndex = WorkPackagesTableService.selectRowRange(scope.rows, row, activeSelectionBorderIndex);
} else if($event.ctrlKey){
setRowSelectionState(row, multipleChecked ? true : !currentRowCheckState);
} else { } else {
setRowSelectionState(row, multipleChecked ? true : !currentRowCheckState); setRowSelectionState(row, multipleChecked ? true : !currentRowCheckState);

@ -32,6 +32,11 @@ var expect = require('../../spec_helper.js').expect,
describe('OpenProject', function() { describe('OpenProject', function() {
var page = new WorkPackagesPage(); var page = new WorkPackagesPage();
beforeEach(function() {
page.get();
browser.waitForAngular();
});
it('should show work packages title', function() { it('should show work packages title', function() {
page.get(); page.get();
@ -52,4 +57,28 @@ describe('OpenProject', function() {
]); ]);
}); });
}); });
describe('click', function() {
context('with Ctrl', function() {
var newWindowHandle;
beforeEach(function() {
var link = element(by.css('[title="16923"]'));
browser.actions()
.mouseMove(link)
.sendKeys(protractor.Key.CONTROL)
.click()
.perform();
});
it('opens new tab', function() {
browser.getAllWindowHandles().then(function (handles) {
newWindowHandle = handles[1];
browser.switchTo().window(newWindowHandle).then(function () {
expect(browser.getCurrentUrl()).to.eventually.contain('/work_packages/16923');
});
});
});
});
});
}); });

Loading…
Cancel
Save