Disable shields for testing
Hey,
I'm using the filament-shield package.
How do you disable all the shields for testing? In my testcase I do
But I still get a 403. I guess it's because of shields
16 Replies
You should implement the FilamentUser interface
https://filamentphp.com/docs/3.x/panels/installation#allowing-users-to-access-a-panel
You could create the user and add the role
Then I get:
There is no role named 'admin' for guard 'web'
What roles does it have?
I guess none because I didn't seed anything
I Guess I need to run my shieldseeder before every test
You could do it and add
protected $seed = true;
in the TestCase
But then it will run all seeders.
I did
$this->seed(ShieldSeeder::class);
It solved the error regarding logging in.ok
did it work?
It got me passed logging in but didn't solve my test. B/c I had t he same error before logging in on my smoke test.
But still getting:
Expected response status code [>=200 <300] but received 403.
The user cannot access the resource..
Weird.
This should work
I agree.. did you implement the FilamentUser interface?
Not sure what you mean by this
Do you mean if I can access the application from a browser?
It does implement that interface
ok, what is the test?