Skip to content

Commit 0a64eb0

Browse files
committed
Add a select test for named tuples separate from FTS
1 parent 0df0f9d commit 0a64eb0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

integration-tests/lts/select.test.ts

+22
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,28 @@ describe("select", () => {
500500
);
501501
});
502502

503+
test("named tuples", async () => {
504+
const namedTuple = e.tuple({ foo: e.str("bar") });
505+
const result = await e.select(namedTuple).run(client);
506+
assert.deepEqual(result, { foo: "bar" });
507+
508+
const pathResult = await e.select(namedTuple.foo).run(client);
509+
assert.deepEqual(pathResult, "bar");
510+
511+
const nestedObjectTuple = e.for(e.select(e.Hero), (hero) =>
512+
e.tuple({
513+
hero,
514+
score: e.random(),
515+
})
516+
);
517+
const nestedObjectQuery = e.select(nestedObjectTuple.hero, (hero) => ({
518+
name: hero.name,
519+
order_by: nestedObjectTuple.score,
520+
}));
521+
const nestedObjectResult = await nestedObjectQuery.run(client);
522+
assert.deepEqual(nestedObjectResult, []);
523+
});
524+
503525
test("filter by id", async () => {
504526
const result = await e
505527
.select(e.Hero, () => ({

0 commit comments

Comments
 (0)