Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] isDetailView doesn't work on refernced_list entity id-field #560

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added e2e-test to demonstrate a problem
  • Loading branch information
Vasia Korobkin committed Jul 24, 2015
commit e891f63657c2ed86ecb9f077083e2beed4d64673
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