Skip to content

Commit

Permalink
test(core): ref pointing to CustomField (string value)
Browse files Browse the repository at this point in the history
  • Loading branch information
binier committed Sep 30, 2020
1 parent 2729736 commit d3e1c0e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/core/test/ref.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,15 @@ describe('Ref test', () => {
expect(qStr).toMatch(/likeCount: v1 as likeCount/);
expect(qStr).toMatch(/likeCountVal: val\(v1\)/);
});

it('ref pointing to CustomField(string value)', () => {
const myQuery = query().project(q => ({
myCount: 'count(myField)',
myCountRef: q.ref('myCount'),
}))
const qStr = myQuery.toString();

expect(qStr).toMatch(/myCount: v1 as count\(myField\)/);
expect(qStr).toMatch(/myCountRef: val\(v1\)/);
});
});

0 comments on commit d3e1c0e

Please sign in to comment.