Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/app/api/media/presigned/__tests__/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe("POST /api/media/presigned", () => {
});

it("continues to generate a media signature with a dashboard session", async () => {
(auth.api.getSession as jest.Mock).mockResolvedValue({
(auth.api.getSession as unknown as jest.Mock).mockResolvedValue({
user: { email: "admin@example.com" },
});
(User.findOne as jest.Mock).mockResolvedValue({
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/api/payment/__tests__/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe("payment helpers", () => {
);

expect(membership.status).toBe(Constants.MembershipStatus.ACTIVE);
expect(membership.role).toBe(Constants.MembershipRole.POST);
expect((membership as any).role).toBe(Constants.MembershipRole.POST);
expect(membership.save).toHaveBeenCalled();
expect(addIncludedProductsMemberships).toHaveBeenCalledWith({
domain: domain._id,
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/api/payment/initiate/__tests__/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("Payment Initiate Route", () => {
},
} as unknown as NextRequest;

(auth.api.getSession as jest.Mock).mockResolvedValue({
(auth.api.getSession as unknown as jest.Mock).mockResolvedValue({
user: {
email: "test@test.com",
},
Expand Down Expand Up @@ -125,7 +125,7 @@ describe("Payment Initiate Route", () => {
});

it("returns 401 if user is not authenticated", async () => {
(auth.api.getSession as jest.Mock).mockResolvedValue(null);
(auth.api.getSession as unknown as jest.Mock).mockResolvedValue(null);

const response = await POST(mockRequest);
expect(response.status).toBe(401);
Expand Down
4 changes: 2 additions & 2 deletions apps/web/graphql/courses/__tests__/logic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe("updateCourse", () => {
await updateCourse(
{
description: JSON.stringify(updatedDescription),
id: course.courseId,
id: course.courseId as any,
},
{
subdomain: testDomain,
Expand Down Expand Up @@ -209,7 +209,7 @@ describe("updateCourse", () => {
const updatedCourse = await updateCourse(
{
description: JSON.stringify(descriptionWithTempMedia),
id: course.courseId,
id: course.courseId as any,
},
{
subdomain: testDomain,
Expand Down
4 changes: 2 additions & 2 deletions apps/web/graphql/courses/__tests__/move-lesson.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ describe("moveLesson", () => {
expect(updatedCourse?.groups?.[0]?.lessonsOrder).toEqual([lesson1]);
expect(updatedCourse?.groups?.[1]?.lessonsOrder).toEqual([lesson2]);

const updatedLesson = await LessonModel.findOne({
const updatedLesson = (await LessonModel.findOne({
domain: testDomain._id,
lessonId: lesson2,
}).lean();
}).lean()) as any;
expect(updatedLesson?.groupId).toBe(groupId2);
});

Expand Down
2 changes: 1 addition & 1 deletion apps/web/graphql/courses/__tests__/reorder-groups.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ describe("reorderGroups", () => {
await expect(
reorderGroups({
courseId: ownerNoPermissionCourse.courseId,
groupIds: ownerNoPermissionCourse.groups.map((group: any) =>
groupIds: ownerNoPermissionCourse.groups!.map((group: any) =>
group.id.toString(),
),
ctx: {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/graphql/lessons/__tests__/visibility.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,10 @@ describe("Lesson visibility and progress", () => {
expect(lesson.media?.mediaId).toBe(tempMediaId);
expect(lesson.media?.file).toBeUndefined();

const savedLesson = await LessonModel.findOne({
const savedLesson = (await LessonModel.findOne({
lessonId: lesson.lessonId,
domain: testDomain._id,
}).lean();
}).lean()) as any;
expect(savedLesson?.media?.mediaId).toBe(tempMediaId);
expect(savedLesson?.media?.file).toBeUndefined();
});
Expand Down
12 changes: 6 additions & 6 deletions apps/web/graphql/users/__tests__/logic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ describe("updateUser", () => {
),
).rejects.toThrow(responses.action_not_allowed);

const owner = await UserModel.findOne({
const owner = (await UserModel.findOne({
userId: "owner",
domain: domainId,
}).lean();
}).lean()) as any;
expect(owner?.permissions).toEqual([
UIConstants.permissions.manageUsers,
]);
Expand All @@ -109,10 +109,10 @@ describe("updateUser", () => {
ctx,
);

const owner = await UserModel.findOne({
const owner = (await UserModel.findOne({
userId: "owner",
domain: domainId,
}).lean();
}).lean()) as any;
expect(owner?.name).toBe("Updated Owner");
expect(owner?.permissions).toEqual([
UIConstants.permissions.manageUsers,
Expand All @@ -138,10 +138,10 @@ describe("updateUser", () => {
),
).rejects.toThrow(responses.action_not_allowed);

const owner = await UserModel.findOne({
const owner = (await UserModel.findOne({
userId: "owner",
domain: domainId,
}).lean();
}).lean()) as any;
expect(owner?.active).toBe(true);
});
});
Expand Down
4 changes: 2 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"medialit": "0.2.0",
"mongodb": "^6.21.0",
"mongoose": "^8.22.1",
"next": "^16.0.10",
"next": "^16.2.9",
"next-themes": "^0.4.6",
"nodemailer": "^6.7.2",
"pug": "^3.0.2",
Expand Down Expand Up @@ -120,7 +120,7 @@
"@types/react": "19.2.4",
"@types/xml2js": "^0.4.14",
"eslint": "^9.12.0",
"eslint-config-next": "16.0.3",
"eslint-config-next": "^16.2.9",
"eslint-config-prettier": "^9.0.0",
"identity-obj-proxy": "^3.0.0",
"mongodb-memory-server": "^10.1.4",
Expand Down
Loading
Loading