Merge branch 'release/4.2' into release/4.3

pull/3276/head
Jens Ulferts 9 years ago
commit 5f2b93fdb3
  1. 45
      frontend/tests/integration/specs/work-packages/details-pane/details-pane-editable-spec.js
  2. 2
      frontend/tests/integration/specs/work-packages/details-pane/details-pane-helper.js
  3. 14
      frontend/tests/integration/specs/work-packages/work-packages-spec.js
  4. 4
      spec/features/menu_items/query_menu_item_spec.rb
  5. 2
      spec/features/work_packages/details/inplace_editor/work_package_field.rb

@ -33,45 +33,42 @@ var expect = require('../../../spec_helper.js').expect,
describe('OpenProject', function(){
describe('editable', function() {
describe('subject', function() {
var subjectEditor;
beforeEach(function() {
subjectEditor = element(by.css('.inplace-edit.attribute-subject'));
var subjectEditor = function(paneNumber) {
return detailsPaneHelper.loadPane(paneNumber, 'overview').then(function() {
return element(by.css('.inplace-edit.attribute-subject'));
});
};
context('work package with update link', function() {
beforeEach(function() {
detailsPaneHelper.loadPane(819, 'overview');
});
it('should render an editable subject', function() {
expect(subjectEditor.$('.inplace-editing--trigger-link').isPresent()).to.eventually.be.true;
subjectEditor(819).then(function(editor) {
expect(editor.$('.inplace-editing--trigger-link').isPresent())
.to.eventually.be.true;
});
});
context('work package without update link', function() {
beforeEach(function() {
detailsPaneHelper.loadPane(820, 'overview');
});
context('work package without update link', function() {
it('should not render an editable subject', function() {
expect(subjectEditor.$('.inplace-editing--trigger-link').isPresent()).to.eventually.be.false;
subjectEditor(820).then(function(editor) {
expect(editor.$('.inplace-editing--trigger-link').isPresent())
.to.eventually.be.false;
});
});
context('work package with a wrong version', function() {
beforeEach(function() {
detailsPaneHelper.loadPane(821, 'overview');
subjectEditor.$('.inplace-editing--trigger-link').click();
subjectEditor.$('.inplace-edit--control--save a').click();
});
context('work package with a wrong version', function() {
it('should render an error', function() {
expect(
subjectEditor
.$('.inplace-edit--errors')
.isDisplayed()
).to.eventually.be.true;
subjectEditor(821).then(function(editor) {
editor.$('.inplace-editing--trigger-link').click();
editor.$('.inplace-edit--control--save a').click();
return editor;
}).then(function(editor) {
expect(editor.$('.inplace-edit--errors').isDisplayed())
.to.eventually.be.true;
});
});
});
});

@ -32,7 +32,7 @@ var expect = require('../../../spec_helper.js').expect,
function loadPane(workPackageId, paneName) {
var page = new WorkPackageDetailsPane(workPackageId, paneName);
page.get();
browser.waitForAngular();
return browser.waitForAngular();
}
function showAll() {

@ -46,15 +46,19 @@ describe('OpenProject', function() {
it('should show work packages', function() {
page.get();
page.getTableHeaders().getText().then(function(text) {
expect(text).to.include.members([
'',
page.getTableHeaders().map(function(heading) {
return heading.getText();
}).then(function(headingTexts) {
var expected = ['',
'ID',
'TYPE',
'STATUS',
'SUBJECT',
'ASSIGNEE'
]);
'ASSIGNEE'];
for (var i = 0; i < expected.length; i++) {
expect(headingTexts[i]).to.equal(expected[i]);
}
});
});
});

@ -103,11 +103,11 @@ feature 'Query menu items' do
end
it 'displaying a success message', js: true do
flash_element = page.find('.flash', visible: true)
expect(flash_element.text).to eq 'Successful update.'
expect(page).to have_selector('.flash', text: 'Successful update')
end
it 'is renaming and reordering the list', js: true do
ng_wait
# Renaming the query should also reorder the queries. As it is renamed
# from zzzz to aaaa, it should now be the first query menu item.
expect(page).to have_selector('li:nth-child(3) a', text: new_name)

@ -11,7 +11,7 @@ class WorkPackageField
end
def read_state_text
@element.find('.inplace-edit--read-value span').text
@element.find('.inplace-edit--read-value').text
end
def trigger_link

Loading…
Cancel
Save