Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+65
@@ -0,0 +1,65 @@
|
||||
// @vitest-environment node
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const { readAdminBookingWorkspace, runAsAdminBookingOperator } =
|
||||
vi.hoisted(() => ({
|
||||
readAdminBookingWorkspace: vi.fn(),
|
||||
runAsAdminBookingOperator: vi.fn(
|
||||
async (_request, _permission, operation) =>
|
||||
operation({
|
||||
adminUserId: "admin-1",
|
||||
email: "admin@email.com",
|
||||
})
|
||||
),
|
||||
}));
|
||||
|
||||
vi.mock(
|
||||
"~/components/screens/admin/sales/booking/AdminBookingWorkspacePage",
|
||||
() => ({ AdminBookingWorkspacePage: () => null })
|
||||
);
|
||||
vi.mock("~/services/admin/admin-booking-workspace.server", () => ({
|
||||
runAsAdminBookingOperator,
|
||||
readAdminBookingWorkspace,
|
||||
adminBookingOrigin: () => "https://meet.hivegrid.de",
|
||||
}));
|
||||
|
||||
import { loader } from "./bookings";
|
||||
|
||||
describe("admin booking workspace route", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
readAdminBookingWorkspace.mockResolvedValue({
|
||||
meetingTypes: [],
|
||||
pages: [],
|
||||
bookings: [],
|
||||
connectedCalendars: 0,
|
||||
});
|
||||
});
|
||||
|
||||
it("builds its VM behind the dedicated booking permission", async () => {
|
||||
const result = await loader({
|
||||
request: new Request(
|
||||
"https://admin.hivegrid.de/sales/bookings"
|
||||
),
|
||||
params: {},
|
||||
context: {},
|
||||
} as never);
|
||||
|
||||
expect(runAsAdminBookingOperator).toHaveBeenCalledWith(
|
||||
expect.any(Request),
|
||||
[
|
||||
"admin_sales.booking.manage",
|
||||
"admin_sales.communication.read_all",
|
||||
],
|
||||
expect.any(Function)
|
||||
);
|
||||
expect(result.vm).toMatchObject({
|
||||
stats: {
|
||||
upcoming: 0,
|
||||
publishedPages: 0,
|
||||
activeMeetingTypes: 0,
|
||||
connectedCalendars: 0,
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user