Skip to content

Commit

Permalink
Added note and test cases showing withRelatedFields configuration i…
Browse files Browse the repository at this point in the history
…s not working properly
  • Loading branch information
naz committed Jan 7, 2019
1 parent 5b83d74 commit 662f84d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/test/unit/services/url/Resources_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ describe('Unit: services/url/Resources', function () {
should.exist(created.posts[0].data.primary_author);
should.exist(created.posts[0].data.primary_tag);

// FIXME: these fields should correspond to configuration values in withRelatedFields
Object.keys(created.posts[0].data.primary_author).sort().should.eql(['id', 'post_id', 'slug'].sort());
Object.keys(created.posts[0].data.primary_tag).sort().should.eql(['id', 'post_id', 'slug', 'visibility'].sort());

should.exist(created.posts[1].data.primary_author);
should.exist(created.posts[1].data.primary_tag);

Expand Down Expand Up @@ -108,6 +112,8 @@ describe('Unit: services/url/Resources', function () {

should.exist(resources.getByIdAndType(options.eventData.type, options.eventData.id));
obj.tags.length.should.eql(1);

// FIXME: these fields should correspond to configuration values in withRelatedFields
Object.keys(obj.tags[0]).sort().should.eql(['id', 'post_id', 'slug', 'visibility'].sort());
obj.authors.length.should.eql(1);
Object.keys(obj.authors[0]).sort().should.eql(['id', 'post_id', 'slug'].sort());
Expand Down

0 comments on commit 662f84d

Please sign in to comment.