#597 display resource calendar (#630)

This commit is contained in:
lethemanh
2026-03-16 23:35:35 +07:00
committed by GitHub
parent 29f17ce86d
commit 9898278fb5
11 changed files with 313 additions and 6 deletions
+19
View File
@@ -2,6 +2,7 @@ import { clientConfig } from "@/features/User/oidcAuth";
import {
getOpenPaasUser,
updateUserConfigurations,
getResourceDetails,
} from "@/features/User/userAPI";
import { api } from "@/utils/apiUtils";
@@ -24,6 +25,24 @@ describe("getOpenPaasUser", () => {
});
});
describe("getResourceDetails", () => {
it("should fetch and return resource details", async () => {
const mockResource = { _id: "res-123", name: "Meeting Room A" };
const resourceId = "res-123";
(api.get as jest.Mock).mockReturnValue({
json: jest.fn().mockResolvedValue(mockResource),
});
const result = await getResourceDetails(resourceId);
expect(api.get).toHaveBeenCalledWith(
`linagora.esn.resource/api/resources/${resourceId}`
);
expect(result).toEqual(mockResource);
});
});
describe("updateUserConfigurations", () => {
beforeEach(() => {
jest.clearAllMocks();