Skip to content

Commit

Permalink
Add sorting for failing specs
Browse files Browse the repository at this point in the history
  • Loading branch information
robak86 committed Jun 27, 2018
1 parent c2b5b0e commit 1b3b681
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions spec/integration/pipeableApi.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ describe("Queries using pipeable api", () => {
match(m => m.node(DummyGraphNode).as('n')),
where(w => w.literal('n.attr2 >= {val1}').params({val1: 1})),
returns('n'),
orderBy(o => o.aliased('n').attribute('attr2').asc())
);

let matchedNodes:DummyGraphNode[] = await connection.runQuery(matchQuery).pluck('n').toArray();
Expand Down
14 changes: 10 additions & 4 deletions spec/integration/queries.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import {int} from "../../lib/driver/Integer";
import {expectIsNowDate} from "../helpers/assertions";
import {ChildDummyGraphNode} from "../fixtures/ChildDummyGraphNode";
import {DummyGraphRelation} from "../fixtures/DummyGraphRelation";
import {where} from "../../lib/cypher/where";
import {orderBy} from "../../lib/cypher";
import {returns} from "../../lib/cypher/common";
import {match} from "../../lib/cypher/match";

describe("Queries", () => {
let neography:Neography,
Expand Down Expand Up @@ -235,10 +239,12 @@ describe("Queries", () => {

describe("matching using where clause", () => {
it("returns nodes matched by where literal expression", async () => {
let matchQuery = neography.query()
.match(m => m.node(DummyGraphNode).as('n'))
.where(w => w.literal('n.attr2 >= {val1}').params({val1: 1}))
.returns('n');
let matchQuery = neography.query(
match(m => m.node(DummyGraphNode).as('n')),
where(w => w.literal('n.attr2 >= {val1}').params({val1: 1})),
returns('n'),
orderBy(o => o.aliased('n').attribute('attr2').asc())
);

let matchedNodes:DummyGraphNode[] = await connection.runQuery(matchQuery).pluck('n').toArray();
expect(matchedNodes.length).to.eq(2);
Expand Down

0 comments on commit 1b3b681

Please sign in to comment.