We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Matthew-Wise/umbraco-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
empty-recycle-bin.test.ts•1.59 kB
import EmptyRecycleBinTool from "../delete/empty-recycle-bin.js";
import { MediaBuilder } from "./helpers/media-builder.js";
import { MediaTestHelper } from "./helpers/media-test-helper.js";
import { jest } from "@jest/globals";
import { TemporaryFileBuilder } from "../../temporary-file/__tests__/helpers/temporary-file-builder.js";
describe("empty-media-recycle-bin", () => {
const TEST_MEDIA_NAME = "_Test Media Empty Recycle";
let originalConsoleError: typeof console.error;
let tempFileBuilder: TemporaryFileBuilder;
beforeEach(async () => {
originalConsoleError = console.error;
console.error = jest.fn();
tempFileBuilder = await new TemporaryFileBuilder()
.withExampleFile()
.create();
});
afterEach(async () => {
console.error = originalConsoleError;
// Clean up any test media
await MediaTestHelper.cleanup(TEST_MEDIA_NAME);
});
it("should empty the recycle bin", async () => {
// Create a media item and move it to recycle bin
const builder = await new MediaBuilder()
.withName(TEST_MEDIA_NAME)
.withImageMediaType()
.withImageValue(tempFileBuilder.getId())
.create();
await builder.moveToRecycleBin();
// Empty the recycle bin
const result = await EmptyRecycleBinTool().handler({}, { signal: new AbortController().signal });
// Verify the handler response using snapshot
expect(result).toMatchSnapshot();
// Verify the media is no longer in recycle bin
const found = await MediaTestHelper.findMedia(TEST_MEDIA_NAME);
expect(found).toBeUndefined();
});
});