Skip to content

Commit

Permalink
chore: update references to social_rent_earnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-hh-aa committed Dec 12, 2024
1 parent 46bd552 commit bc4ddda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/data/socialRentEarningsRepo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ describe("socialRentEarningsRepo", () => {
const mockEarnings = 500; // Example average earnings

// Mock the Prisma client response
(prisma.socialRent.aggregate as jest.Mock).mockResolvedValueOnce({
(prisma.socialRentEarnings.aggregate as jest.Mock).mockResolvedValueOnce({
_avg: { earningsPerWeek: mockEarnings },
});

const result =
await socialRentEarningsRepo.getSocialRentEarningsByITL3(itl3);

expect(result).toBe(mockEarnings);
expect(prisma.socialRent.aggregate).toHaveBeenCalledWith({
expect(prisma.socialRentEarnings.aggregate).toHaveBeenCalledWith({
where: {
itl3: {
startsWith: itl3.substring(0, 3),
Expand All @@ -42,7 +42,7 @@ describe("socialRentEarningsRepo", () => {
const itl3 = "XYZ123";

// Mock the Prisma client response to return null for earningsPerWeek
(prisma.socialRent.aggregate as jest.Mock).mockResolvedValueOnce({
(prisma.socialRentEarnings.aggregate as jest.Mock).mockResolvedValueOnce({
_avg: { earningsPerWeek: null },
});

Expand All @@ -57,7 +57,7 @@ describe("socialRentEarningsRepo", () => {
const itl3 = "XYZ123";

// Mock the Prisma client to throw an error
(prisma.socialRent.aggregate as jest.Mock).mockRejectedValueOnce(
(prisma.socialRentEarnings.aggregate as jest.Mock).mockRejectedValueOnce(
new Error("Database error")
);

Expand Down
2 changes: 1 addition & 1 deletion app/data/socialRentEarningsRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import prisma from "./db";

const getSocialRentEarningsByITL3 = async (itl3: string): Promise<number> => {
try {
const result = await prisma.socialRent.aggregate({
const result = await prisma.socialRentEarnings.aggregate({
where: {
itl3: {
startsWith: itl3.substring(0, 3),
Expand Down

0 comments on commit bc4ddda

Please sign in to comment.