Adapt frontend-specs to new embedding

just realized that those are 12k lines of C&P activities.
I reduced the amount to a less insane (but still not quite sane) ~1k lines...

It might be a better idea to automatically generate those mocks.
This would be:
- more consistent
- more up-to-date with real data
- less error-prone (b.c. less copypasta)
pull/3427/head
Jan Sandbrink 9 years ago
parent 5de0f15898
commit b41e96a8af
  1. 361
      frontend/tests/integration/mocks/work-packages/819.json
  2. 2194
      frontend/tests/integration/mocks/work-packages/820.json
  3. 2194
      frontend/tests/integration/mocks/work-packages/821.json
  4. 2648
      frontend/tests/integration/mocks/work-packages/822.json
  5. 2183
      frontend/tests/integration/mocks/work-packages/823.json
  6. 2183
      frontend/tests/integration/mocks/work-packages/824.json
  7. 2183
      frontend/tests/integration/mocks/work-packages/825.json
  8. 9
      frontend/tests/integration/specs/work-packages/details-pane/activity-with-revisions-spec.js
  9. 14
      frontend/tests/unit/tests/work_packages/controllers/work-package-details-controller-test.js

@ -140,6 +140,9 @@
},
"attachments": {
"href": "/api/v3/work_packages/819/attachments"
},
"activities": {
"href": "/api/v3/work_packages/819/activities"
}
},
"_embedded": {
@ -279,189 +282,199 @@
"updatedAt": "2015-02-13T10:08:53+00:00",
"type": null
},
"activities": [
{
"_type": "Activity",
"_links": {
"self": {
"href": "/api/v3/activities/333",
"title": "333"
},
"workPackage": {
"href": "/api/v3/work_packages/65",
"title": "veritatis voluptas hic qui praesentium tempora illum omnis"
},
"user": {
"href": "/api/v3/users/3",
"title": "Anonymous - "
},
"update": {
"href": "/api/v3/activities/333",
"method": "patch",
"title": "333"
}
},
"id": 333,
"comment": {
"format": "textile",
"raw": "",
"html": ""
},
"details": [
{
"format": "custom",
"raw": "Type set to Phase",
"html": "<strong>Type</strong> set to <i title=\"Phase\">Phase</i>"
},
{
"format": "custom",
"raw": "Project set to Seeded Project",
"html": "<strong>Project</strong> set to <i title=\"Seeded Project\">Seeded Project</i>"
},
{
"format": "custom",
"raw": "Subject set to veritatis voluptas hic qui praesentium tempora illum omnis",
"html": "<strong>Subject</strong> set to <i title=\"veritatis voluptas hic qui praesentium tempora illum omnis\">veritatis voluptas hic qui praesentium tempora illum omnis</i>"
},
{
"format": "custom",
"raw": "Description set (/journals/333/diff/description)",
"html": "<strong>Description</strong> set (<a href=\"/journals/333/diff/description\" class=\"description-details\">Details</a>)"
},
{
"format": "custom",
"raw": "Due date set to 04/29/2015",
"html": "<strong>Due date</strong> set to <i title=\"04/29/2015\">04/29/2015</i>"
},
{
"format": "custom",
"raw": "Status set to new",
"html": "<strong>Status</strong> set to <i title=\"new\">new</i>"
},
{
"format": "custom",
"raw": "Priority set to Normal",
"html": "<strong>Priority</strong> set to <i title=\"Normal\">Normal</i>"
},
"activities": {
"_type": "Collection",
"_links": {
"self": { "href": "/api/v3/work_packages/819/activities" }
},
"total": 4,
"count": 4,
"_embedded": {
"elements": [
{
"format": "custom",
"raw": "Author set to Alexandrine Heidenreich",
"html": "<strong>Author</strong> set to <i title=\"Alexandrine Heidenreich\">Alexandrine Heidenreich</i>"
"_type": "Activity",
"_links": {
"self": {
"href": "/api/v3/activities/333",
"title": "333"
},
"workPackage": {
"href": "/api/v3/work_packages/65",
"title": "veritatis voluptas hic qui praesentium tempora illum omnis"
},
"user": {
"href": "/api/v3/users/3",
"title": "Anonymous - "
},
"update": {
"href": "/api/v3/activities/333",
"method": "patch",
"title": "333"
}
},
"id": 333,
"comment": {
"format": "textile",
"raw": "",
"html": ""
},
"details": [
{
"format": "custom",
"raw": "Type set to Phase",
"html": "<strong>Type</strong> set to <i title=\"Phase\">Phase</i>"
},
{
"format": "custom",
"raw": "Project set to Seeded Project",
"html": "<strong>Project</strong> set to <i title=\"Seeded Project\">Seeded Project</i>"
},
{
"format": "custom",
"raw": "Subject set to veritatis voluptas hic qui praesentium tempora illum omnis",
"html": "<strong>Subject</strong> set to <i title=\"veritatis voluptas hic qui praesentium tempora illum omnis\">veritatis voluptas hic qui praesentium tempora illum omnis</i>"
},
{
"format": "custom",
"raw": "Description set (/journals/333/diff/description)",
"html": "<strong>Description</strong> set (<a href=\"/journals/333/diff/description\" class=\"description-details\">Details</a>)"
},
{
"format": "custom",
"raw": "Due date set to 04/29/2015",
"html": "<strong>Due date</strong> set to <i title=\"04/29/2015\">04/29/2015</i>"
},
{
"format": "custom",
"raw": "Status set to new",
"html": "<strong>Status</strong> set to <i title=\"new\">new</i>"
},
{
"format": "custom",
"raw": "Priority set to Normal",
"html": "<strong>Priority</strong> set to <i title=\"Normal\">Normal</i>"
},
{
"format": "custom",
"raw": "Author set to Alexandrine Heidenreich",
"html": "<strong>Author</strong> set to <i title=\"Alexandrine Heidenreich\">Alexandrine Heidenreich</i>"
},
{
"format": "custom",
"raw": "% done changed from 0 to 0",
"html": "<strong>% done</strong> changed from <i title=\"0\">0</i> to <i title=\"0\">0</i>"
},
{
"format": "custom",
"raw": "Start date set to 02/17/2015",
"html": "<strong>Start date</strong> set to <i title=\"02/17/2015\">02/17/2015</i>"
}
],
"version": 1,
"createdAt": "2015-02-13T10:09:07+00:00"
},
{
"format": "custom",
"raw": "% done changed from 0 to 0",
"html": "<strong>% done</strong> changed from <i title=\"0\">0</i> to <i title=\"0\">0</i>"
"_type": "Activity",
"_links": {
"self": {
"href": "/api/v3/activities/816",
"title": "816"
},
"workPackage": {
"href": "/api/v3/work_packages/65",
"title": "veritatis voluptas hic qui praesentium tempora illum omnis"
},
"user": {
"href": "/api/v3/users/1",
"title": "OpenProject Admin - admin"
},
"update": {
"href": "/api/v3/activities/816",
"method": "patch",
"title": "816"
}
},
"id": 816,
"comment": {
"format": "textile",
"raw": "",
"html": ""
},
"details": [
{
"format": "custom",
"raw": "Status changed from new to in progress",
"html": "<strong>Status</strong> changed from <i title=\"new\">new</i> to <i title=\"in progress\">in progress</i>"
}
],
"version": 2,
"createdAt": "2015-04-07T13:36:43+00:00"
},
{
"format": "custom",
"raw": "Start date set to 02/17/2015",
"html": "<strong>Start date</strong> set to <i title=\"02/17/2015\">02/17/2015</i>"
}
],
"version": 1,
"createdAt": "2015-02-13T10:09:07+00:00"
},
{
"_type": "Activity",
"_links": {
"self": {
"href": "/api/v3/activities/816",
"title": "816"
"_type": "Activity::Comment",
"_links": {
"self": {
"href": "/api/v3/activities/817",
"title": "817"
},
"workPackage": {
"href": "/api/v3/work_packages/65",
"title": "veritatis voluptas hic qui praesentium tempora illum omnis"
},
"user": {
"href": "/api/v3/users/1",
"title": "OpenProject Admin - admin"
},
"update": {
"href": "/api/v3/activities/817",
"method": "patch",
"title": "817"
}
},
"id": 817,
"comment": {
"format": "textile",
"raw": "I have a comment",
"html": "<p>I have a comment</p>"
},
"details": [],
"version": 3,
"createdAt": "2015-04-07T13:37:09+00:00"
},
"workPackage": {
"href": "/api/v3/work_packages/65",
"title": "veritatis voluptas hic qui praesentium tempora illum omnis"
},
"user": {
"href": "/api/v3/users/1",
"title": "OpenProject Admin - admin"
},
"update": {
"href": "/api/v3/activities/816",
"method": "patch",
"title": "816"
}
},
"id": 816,
"comment": {
"format": "textile",
"raw": "",
"html": ""
},
"details": [
{
"format": "custom",
"raw": "Status changed from new to in progress",
"html": "<strong>Status</strong> changed from <i title=\"new\">new</i> to <i title=\"in progress\">in progress</i>"
"_type": "Activity::Comment",
"_links": {
"self": {
"href": "/api/v3/activities/818",
"title": "818"
},
"workPackage": {
"href": "/api/v3/work_packages/65",
"title": "veritatis voluptas hic qui praesentium tempora illum omnis"
},
"user": {
"href": "/api/v3/users/1",
"title": "OpenProject Admin - admin"
},
"update": {
"href": "/api/v3/activities/818",
"method": "patch",
"title": "818"
}
},
"id": 818,
"comment": {
"format": "textile",
"raw": "And another one",
"html": "<p>And another one</p>"
},
"details": [],
"version": 4,
"createdAt": "2015-04-07T13:37:33+00:00"
}
],
"version": 2,
"createdAt": "2015-04-07T13:36:43+00:00"
},
{
"_type": "Activity::Comment",
"_links": {
"self": {
"href": "/api/v3/activities/817",
"title": "817"
},
"workPackage": {
"href": "/api/v3/work_packages/65",
"title": "veritatis voluptas hic qui praesentium tempora illum omnis"
},
"user": {
"href": "/api/v3/users/1",
"title": "OpenProject Admin - admin"
},
"update": {
"href": "/api/v3/activities/817",
"method": "patch",
"title": "817"
}
},
"id": 817,
"comment": {
"format": "textile",
"raw": "I have a comment",
"html": "<p>I have a comment</p>"
},
"details": [],
"version": 3,
"createdAt": "2015-04-07T13:37:09+00:00"
},
{
"_type": "Activity::Comment",
"_links": {
"self": {
"href": "/api/v3/activities/818",
"title": "818"
},
"workPackage": {
"href": "/api/v3/work_packages/65",
"title": "veritatis voluptas hic qui praesentium tempora illum omnis"
},
"user": {
"href": "/api/v3/users/1",
"title": "OpenProject Admin - admin"
},
"update": {
"href": "/api/v3/activities/818",
"method": "patch",
"title": "818"
}
},
"id": 818,
"comment": {
"format": "textile",
"raw": "And another one",
"html": "<p>And another one</p>"
},
"details": [],
"version": 4,
"createdAt": "2015-04-07T13:37:33+00:00"
]
}
],
},
"watchers": [],
"attachments" : {
"_links" : {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -27,8 +27,8 @@
//++
var expect = require('../../../spec_helper.js').expect,
detailsPaneHelper = require('./details-pane-helper.js'),
elements = detailsPaneHelper.elements;
detailsPaneHelper = require('./details-pane-helper.js'),
elements = detailsPaneHelper.elements;
/*jshint expr: true*/
@ -37,15 +37,14 @@ describe('OpenProject', 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);
elements.count(locator, 5);
});
it('should render one revision at the correct position', function() {
expect(
$('.work-package-details-activities-activity:nth-of-type(61) .date').getText()
$('.work-package-details-activities-activity:nth-of-type(5) .date').getText()
).to.eventually.contain('committed revision 1cb82424');
});
});

@ -57,7 +57,17 @@ describe('WorkPackageDetailsController', function() {
id: 1
}
},
activities: [],
activities: {
links: {
self: { href: "/api/v3/work_packages/820/activities" }
},
_type: "Collection",
total: 0,
count: 0,
embedded: {
elements: []
}
},
watchers: [],
attachments: {
links: {
@ -125,7 +135,7 @@ describe('WorkPackageDetailsController', function() {
buildController = function() {
var testState = {
current: { url: '/overview', },
current: { url: '/overview' }
};
scope = $rootScope.$new();

Loading…
Cancel
Save