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. 17
      frontend/tests/integration/mocks/work-packages/819.json
  2. 2018
      frontend/tests/integration/mocks/work-packages/820.json
  3. 2018
      frontend/tests/integration/mocks/work-packages/821.json
  4. 2472
      frontend/tests/integration/mocks/work-packages/822.json
  5. 2021
      frontend/tests/integration/mocks/work-packages/823.json
  6. 2021
      frontend/tests/integration/mocks/work-packages/824.json
  7. 2021
      frontend/tests/integration/mocks/work-packages/825.json
  8. 5
      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,7 +282,15 @@
"updatedAt": "2015-02-13T10:08:53+00:00",
"type": null
},
"activities": [
"activities": {
"_type": "Collection",
"_links": {
"self": { "href": "/api/v3/work_packages/819/activities" }
},
"total": 4,
"count": 4,
"_embedded": {
"elements": [
{
"_type": "Activity",
"_links": {
@ -461,7 +472,9 @@
"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

@ -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