feat: refactoring casl permission checks for recursive nested operations (#778)
* feat: nested casl abilities * fix: remove unused packages * Fixes * Fix createMany broken * Fix lint * Fix lint * Fix lint * Fix lint * Fixes * Fix CommentThread * Fix bugs * Fix lint * Fix bugs * Fixed auto routing * Fixed app path --------- Co-authored-by: Charles Bochet <charles@twenty.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -1,9 +1,6 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { CanActivate } from '@nestjs/common';
|
||||
|
||||
import { CommentThreadService } from 'src/core/comment/services/comment-thread.service';
|
||||
import { CreateOneCommentGuard } from 'src/guards/create-one-comment.guard';
|
||||
import { CreateOneCommentThreadGuard } from 'src/guards/create-one-comment-thread.guard';
|
||||
import { AbilityFactory } from 'src/ability/ability.factory';
|
||||
|
||||
import { CommentThreadResolver } from './comment-thread.resolver';
|
||||
@ -12,8 +9,6 @@ describe('CommentThreadResolver', () => {
|
||||
let resolver: CommentThreadResolver;
|
||||
|
||||
beforeEach(async () => {
|
||||
const mockGuard: CanActivate = { canActivate: jest.fn(() => true) };
|
||||
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [
|
||||
CommentThreadResolver,
|
||||
@ -26,12 +21,7 @@ describe('CommentThreadResolver', () => {
|
||||
useValue: {},
|
||||
},
|
||||
],
|
||||
})
|
||||
.overrideGuard(CreateOneCommentGuard)
|
||||
.useValue(mockGuard)
|
||||
.overrideGuard(CreateOneCommentThreadGuard)
|
||||
.useValue(mockGuard)
|
||||
.compile();
|
||||
}).compile();
|
||||
|
||||
resolver = module.get<CommentThreadResolver>(CommentThreadResolver);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user