Skip to content

Commit

Permalink
fix pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
harishv7 committed Jan 15, 2025
1 parent ec1a0a8 commit 70ea755
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions apps/studio/src/server/modules/user/__tests__/user.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@
import { resetTables } from "tests/integration/helpers/db"
import { setupUser, setUpWhitelist } from "tests/integration/helpers/seed"
import { setupUser } from "tests/integration/helpers/seed"

import { isUserDeleted } from "../user.service"

describe("user.service", () => {
beforeAll(async () => {
await resetTables("User")
await setUpWhitelist({ email: "@example.com" })
})

it("should return false if user is not deleted", async () => {
// Arrange
const email = "active@example.com"
// Setup active user
await setupUser({
name: "Active User",
userId: "active123",
email: "active@example.com",
email: email,
phone: "12345678",
isDeleted: false,
})

// Setup deleted user
await setupUser({
name: "Deleted User",
userId: "deleted123",
email: "deleted@example.com",
phone: "12345678",
isDeleted: true,
})
})

it("should return false if user is not deleted", async () => {
// Arrange
const email = "active@example.com"
// Act
const result = await isUserDeleted(email)
// Assert
Expand All @@ -39,6 +29,15 @@ describe("user.service", () => {
it("should return true if user is deleted", async () => {
// Arrange
const email = "deleted@example.com"
// Setup deleted user
await setupUser({
name: "Deleted User",
userId: "deleted123",
email: email,
phone: "12345678",
isDeleted: true,
})

// Act
const result = await isUserDeleted(email)
// Assert
Expand Down

0 comments on commit 70ea755

Please sign in to comment.