You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running into some issues when trying to implement simple tests for components wrapped by CASL, and I can't find much information about how to implement those test in this kind of cases.
Here is an example of what's happening to me:
I have some simple components that are just wrapped by a simple <Can I="see" a="post>:
But when I try to build a simple test such as the following dummy one it fails to pass the condition and the snapshot ends as a simple exports['Can I see a post'] = 'null';
describe('Can I see a post',()=>{beforeAll(()=>{ability.update([]);construles={action: 'see',subject: 'post',};ability.update(rules);});it('Renders just fine',()=>{constcomponent=renderer.create(<Post/>).toJSON();expect(component).toMatchSnapshot();});});
I have console logged abilities after updating it and its rules are just empty, but I have implemented it as I do in the app itself. I am missing something here (probably very simple) but I just don't see what it is.
The text was updated successfully, but these errors were encountered:
I am running into some issues when trying to implement simple tests for components wrapped by CASL, and I can't find much information about how to implement those test in this kind of cases.
Here is an example of what's happening to me:
I have some simple components that are just wrapped by a simple <Can I="see" a="post>:
But when I try to build a simple test such as the following dummy one it fails to pass the condition and the snapshot ends as a simple
exports['Can I see a post'] = 'null';
I have console logged abilities after updating it and its rules are just empty, but I have implemented it as I do in the app itself. I am missing something here (probably very simple) but I just don't see what it is.
The text was updated successfully, but these errors were encountered: