- The security-relevant catch->not_found branch in lookupTemplate (returns not_found instead of raw content when comment-mark stripping throws) is now tested by forcing the strip to throw with a malformed text node, asserting no content/marks leak. - not_found for a soft-deleted source resolved through the REAL filterViewerAccessiblePageIds (deletedAt-excluded), not the stubbed filter. - Rename the misleading 'honours <=50 cap' test to reflect it only exercises dedup (the cap lives in the DTO, never engaged in the service unit). - Cover the onlyTemplates search filter (restricts to is_template=true). Also fix two pre-existing failing 'should be defined' specs (search service + controller) that couldn't resolve the @InjectKysely token via createTestingModule. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 lines
712 B
TypeScript
23 lines
712 B
TypeScript
import { SearchController } from './search.controller';
|
|
|
|
// Direct instantiation with stub deps. The Test.createTestingModule form failed
|
|
// to resolve SearchService's @InjectKysely() connection token at compile() (the
|
|
// same Nest-DI/Kysely-token issue addressed in search.service.spec), and this
|
|
// unit only needs the controller to construct.
|
|
describe('SearchController', () => {
|
|
let controller: SearchController;
|
|
|
|
beforeEach(() => {
|
|
controller = new SearchController(
|
|
{} as any, // searchService
|
|
{} as any, // spaceAbility
|
|
{} as any, // environmentService
|
|
{} as any, // moduleRef
|
|
);
|
|
});
|
|
|
|
it('should be defined', () => {
|
|
expect(controller).toBeDefined();
|
|
});
|
|
});
|