Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
unit(policy): wait for deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Oct 11, 2022
1 parent 54687e1 commit 6e743e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/policies/scope-based.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ describe("Middleware: Scope-Based Policy", () => {
[ "update", "writeOverallScope" ],
async(): Promise<DeserializedUserDocument<"roles"|"department">> => {
const owner = await new UserFactory().attach(role).in(department).insertOne()
return new UserFactory().deserialize(owner) as DeserializedUserDocument<
return await new UserFactory()
.deserialize(owner) as DeserializedUserDocument<
"roles"|"department"
>
}
Expand Down Expand Up @@ -95,7 +96,7 @@ describe("Middleware: Scope-Based Policy", () => {
[ "update", "writeOverallScope" ],
async(): Promise<DeserializedUserDocument<"roles"|"department">> => {
const owner = await new UserFactory().attach(role).insertOne()
return new UserFactory().deserialize(
return await new UserFactory().deserialize(
owner
) as DeserializedUserDocument<"roles"|"department">
}
Expand Down

0 comments on commit 6e743e5

Please sign in to comment.