Skip to content

Commit

Permalink
Added e2e-test to demonstrate a problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasia Korobkin committed Jul 24, 2015
1 parent de7ed47 commit e891f63
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/blog/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
.targetEntity(comment)
.targetReferenceField('post_id')
.targetFields([
nga.field('id').isDetailLink(true),
nga.field('created_at').label('Posted'),
nga.field('body').label('Comment')
])
Expand Down
13 changes: 13 additions & 0 deletions src/javascripts/test/e2e/EditionViewSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,17 @@ describe('EditionView', function () {
});
});
});

describe('DetailLink', function() {
beforeEach(function() {
browser.baseUrl + '#/posts/edit/1';
});

it('should redirect to corresponding detail view even for referenced_list entity', function () {
$$('#row-comments td a').first().click();
browser.getLocationAbsUrl().then(function(url){
expect(url).toContain('/comments/edit/');
});
});
});
});
7 changes: 4 additions & 3 deletions src/javascripts/test/e2e/ShowViewSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ describe('ShowView', function () {
describe('ReferencedListField', function() {
it('should render as a datagrid', function () {
$$('.ng-admin-field-comments th').then(function (inputs) {
expect(inputs.length).toBe(2);
expect(inputs.length).toBe(3);

expect(inputs[0].getAttribute('class')).toBe('ng-scope ng-admin-column-created_at');
expect(inputs[1].getAttribute('class')).toBe('ng-scope ng-admin-column-body');
expect(inputs[0].getAttribute('class')).toBe('ng-scope ng-admin-column-id');
expect(inputs[1].getAttribute('class')).toBe('ng-scope ng-admin-column-created_at');
expect(inputs[2].getAttribute('class')).toBe('ng-scope ng-admin-column-body');
});
});
});
Expand Down

0 comments on commit e891f63

Please sign in to comment.