Replies: 2 comments
-
with this code it work beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
...
],
imports: [
...,
AbilityModule,
],
providers: [
{ provide: HttpClient, useValue: httpClientSpy },
{ provide: PureAbility, useValue: createMongoAbility() },
]
})
.compileComponents();
const abilities = [{ action: 'manage', subject: 'all' }];
const ability = new PureAbility(abilities);
TestBed.overrideProvider(PureAbility, { useValue: ability });
...
... |
Beta Was this translation helpful? Give feedback.
0 replies
-
you can always check actual project tests to find some samples -> https://github.com/stalniy/casl/blob/master/packages/casl-angular/spec/pipes.e2e.spec.ts |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use angular/casl
I'm just trying to get the tests to work
example:
with : *ngIf="'create' | able: 'agence'..., ---> the button is not found
without : *ngIf="'create' | able: 'agence'... ---> the button is found
I have however defined ability in the beforeEach
do you have documentation? a sample test?
anyone who can help me
Beta Was this translation helpful? Give feedback.
All reactions