Revision integration tests

pull/3323/head
Oliver Günther 9 years ago
parent ccd86a4b75
commit 3c489a9cc8
  1. 3
      frontend/tests/integration/mocks/work-package.json
  2. 7
      frontend/tests/integration/mocks/work-packages.js
  3. 3
      frontend/tests/integration/mocks/work-packages/820.json
  4. 39
      frontend/tests/integration/mocks/work-packages/820_revisions.json
  5. 25
      frontend/tests/integration/mocks/work-packages/revisions/1.json
  6. 25
      frontend/tests/integration/mocks/work-packages/revisions/2.json
  7. 2
      frontend/tests/integration/protractor.conf.js
  8. 52
      frontend/tests/integration/specs/work-packages/details-pane/activity-with-revisions-spec.js

@ -75,6 +75,9 @@
"project": {
"href": "/api/v3/projects/2",
"title": "Seeded Project"
},
"revisions": {
"href": "/api/v3/work_packages/819/revisions",
}
},
"id": 819,

@ -38,6 +38,13 @@ module.exports = function(app) {
res.send(text);
});
});
workPackagesRouter.get('/:id/revisions', function(req, res) {
fs.readFile(
__dirname + '/work-packages/' + req.params.id + '_revisions.json',
'utf8', function(err, text) {
res.send(text);
});
});
workPackagesRouter.post('/:id/form', function(req, res) {
fs.readFile(
__dirname + '/work-packages/' + req.params.id + '_form.json',

@ -82,6 +82,9 @@
},
"schema": {
"href": "/api/v3/work_packages/schemas/1-7"
},
"revisions": {
"href": "/api/v3/work_packages/820/revisions"
}
},
"id": 820,

@ -0,0 +1,39 @@
{
"_links": {
"self": {
"href": "/api/v3/work_packages/820/revisions"
}
},
"_type": "Collection",
"total": 1,
"count": 1,
"_embedded": {
"elements": [
{
"_type": "Revision",
"_links": {
"self": {
"href": "/api/v3/revisions/1"
},
"project": {
"href": "/api/v3/projects/6",
"title": "foobar"
},
"showRevision": {
"href": "/projects/foobar/repository/revision/1cb824244ccb839bfce5a463a58b108cf8fbd4da"
}
},
"id": 1,
"identifier": "1cb824244ccb839bfce5a463a58b108cf8fbd4da",
"formattedIdentifier": "1cb82424",
"authorName": "Oliver Günther ",
"message": {
"format": "plain",
"raw": "Awesome commit\n\nTotally references #820, really now.",
"html": "<p>This does something</p>\n\n<p>Totally references <a href=\"/work_packages/820\" class=\"issue work_package status-1 priority-2 created-by-me\" title=\"asdf (new)\">#820</a>, really now</p>"
},
"createdAt": "2015-08-13T11:04:24+00:00"
}
]
}
}

@ -0,0 +1,25 @@
{
"_type": "Revision",
"_links": {
"self": {
"href": "/api/v3/revisions/2355"
},
"project": {
"href": "/api/v3/projects/6",
"title": "subrepos1"
},
"showRevision": {
"href": "/projects/subrepos1/repository/revision/1cb824244ccb839bfce5a463a58b108cf8fbd4da"
}
},
"id": 2355,
"identifier": "1cb824244ccb839bfce5a463a58b108cf8fbd4da",
"formattedIdentifier": "1cb82424",
"authorName": "Oliver Günther ",
"message": {
"format": "plain",
"raw": "Awesome commit\n\nTotally references #819, really now.",
"html": "<p>This does something</p>\n\n<p>Totally references <a href=\"/work_packages/819\" class=\"issue work_package status-1 priority-2 created-by-me\" title=\"asdf (new)\">#819</a>, really now</p>"
},
"createdAt": "2015-08-13T11:04:24+00:00"
}

@ -0,0 +1,25 @@
{
"_type": "Revision",
"_links": {
"self": {
"href": "/api/v3/revisions/2"
},
"project": {
"href": "/api/v3/projects/1",
"title": "Seeded Project"
},
"showRevision": {
"href": "/projects/subrepos1/repository/revision/1ea7d580"
}
},
"id": 2,
"identifier": "1ea7d580a323f6267752347ef4b23c120445196e",
"formattedIdentifier": "1ea7d580",
"authorName": "Oliver G\u00fcnther ",
"message": {
"format": "plain",
"raw": "Totally references #81",
"html": "<p>Totally references <a href=\"/work_packages/819\" class=\"issue work_package status-1 priority-5 parent created-by-me\" title=\"veritatis voluptas hic qui praesentium tempora illum omnis (new)\">#81</a></p>"
},
"createdAt": "2015-08-07T06:22:49+00:00"
}

@ -35,7 +35,7 @@ exports.config = {
'browserName': 'firefox'
},
directConnect: true,
directConnect: false,
specs: [
'specs/*spec.js',

@ -0,0 +1,52 @@
//-- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See doc/COPYRIGHT.rdoc for more details.
//++
var expect = require('../../../spec_helper.js').expect,
detailsPaneHelper = require('./details-pane-helper.js'),
elements = detailsPaneHelper.elements;
/*jshint expr: true*/
describe('OpenProject', function() {
describe('activity pane with revisions', function() {
beforeEach(function() {
detailsPaneHelper.loadPane(820, 'activity');
});
it('should render all activities and one revision', function() {
var locator = by.css('.work-package-details-activities-activity');
elements.count(locator, 61);
});
it('should render one revision at the correct position', function() {
expect(
$('.work-package-details-activities-activity:nth-of-type(61) .date').getText()
).to.eventually.contain('committed revision 1cb82424');
});
});
});
Loading…
Cancel
Save