You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/setup-tests/setup-handlers/docker.ts

24 lines
742 B

import { DefaultBodyType, PathParams, rest } from 'msw';
import { SystemInfo } from 'docker-types/generated/1.41';
import { VersionResponse } from '@/react/docker/proxy/queries/useVersion';
export const dockerHandlers = [
rest.get<DefaultBodyType, PathParams, SystemInfo>(
'/api/endpoints/:endpointId/docker/info',
(req, res, ctx) =>
res(
ctx.json({
Plugins: { Authorization: [], Log: [], Network: [], Volume: [] },
MemTotal: 0,
NCPU: 0,
Runtimes: { runc: { path: 'runc' } },
})
)
),
rest.get<DefaultBodyType, PathParams, VersionResponse>(
'/api/endpoints/:endpointId/docker/version',
(req, res, ctx) => res(ctx.json({ ApiVersion: '1.24' }))
),
];