Skip to content

Commit

Permalink
Move UUID->Object cast test into LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttrinh committed Jan 17, 2024
1 parent 9b0e5a4 commit 2466948
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 57 deletions.
17 changes: 17 additions & 0 deletions integration-tests/lts/casts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,21 @@ describe("casts", () => {

tc.assert<tc.IsExact<(typeof expr)["__element__"], $Movie>>(true);
});

test("UUID to object cast", () => {
const expr = e.cast(
e.Movie,
e.cast(e.uuid, "00000000-0000-0000-0000-000000000000")
);

assert.equal(
expr.toEdgeQL(),
`<default::Movie>(<std::uuid>("00000000-0000-0000-0000-000000000000"))`
);

tc.assert<tc.IsExact<(typeof expr)["__element__"], $Movie>>(true);

// @ts-expect-error: does not allow assignment of non UUID
e.cast(e.Movie, 42);
});
});
57 changes: 0 additions & 57 deletions integration-tests/stable/uuid-to-object-cast.test.ts

This file was deleted.

0 comments on commit 2466948

Please sign in to comment.