|
|
@@ -1,33 +0,0 @@
|
|
|
-import type { HydratedDocument } from 'mongoose';
|
|
|
-import mongoose from 'mongoose';
|
|
|
-import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';
|
|
|
-
|
|
|
-describe('/page/shared endpoint integration tests', () => {
|
|
|
- // These are placeholder tests for integration testing
|
|
|
- // Full integration tests require a test database and API server setup
|
|
|
-
|
|
|
- it('should have endpoint factory exported', () => {
|
|
|
- // Import to verify the factory exists and is importable
|
|
|
- const factory =
|
|
|
- require('./get-page-by-share-link').getPageByShareLinkHandlerFactory;
|
|
|
- expect(factory).toBeDefined();
|
|
|
- expect(typeof factory).toBe('function');
|
|
|
- });
|
|
|
-
|
|
|
- it('should return RequestHandler array from factory', () => {
|
|
|
- // Mock Crowi instance
|
|
|
- const mockCrowi = {
|
|
|
- pageService: {},
|
|
|
- pageGrantService: {},
|
|
|
- };
|
|
|
-
|
|
|
- const factory =
|
|
|
- require('./get-page-by-share-link').getPageByShareLinkHandlerFactory;
|
|
|
- const handlers = factory(mockCrowi);
|
|
|
-
|
|
|
- expect(Array.isArray(handlers)).toBe(true);
|
|
|
- expect(handlers.length).toBeGreaterThan(0);
|
|
|
- // Last handler should be the main handler function
|
|
|
- expect(typeof handlers[handlers.length - 1]).toBe('function');
|
|
|
- });
|
|
|
-});
|