Revert failing test.

This commit is contained in:
Sam Rose 2024-11-20 12:37:47 +00:00
parent 8944b0908b
commit cf57c7a0d0
No known key found for this signature in database
1 changed files with 20 additions and 1 deletions

View File

@ -36,7 +36,26 @@ describe("UserDB", () => {
describe("save", () => {
describe("create", () => {
it("creating a new user will persist it", async () => {
throw new Error("oh no")
const email = generator.email({})
const user: User = structures.users.user({
email,
tenantId: config.getTenantId(),
})
await config.doInTenant(async () => {
const saveUserResponse = await db.save(user)
const persistedUser = await db.getUserByEmail(email)
expect(persistedUser).toEqual({
...user,
_id: saveUserResponse._id,
_rev: expect.stringMatching(/^1-\w+/),
password: expect.not.stringMatching(user.password!),
status: UserStatus.ACTIVE,
createdAt: Date.now(),
updatedAt: new Date().toISOString(),
})
})
})
it("the same email cannot be used twice in the same tenant", async () => {