-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with Laravel 9.35 Model::preventsAccessingMissingAttributes() #1164
Comments
Confirmed with Laravel 9.36.4 and Jetstream 2.12.3 on a brand new install. I haven't had time to fully investigate, but this seems to be related to |
I don't think it's a bug, you have to add what you need to the UserFactory, 'current_team_id' => null,
'profile_photo_path' => null,
'two_factor_secret' => null, |
@flick36 But... the UserFactory is created by Jetstream. Shouldn't the user factory it creates work with the tests it creates, while using this new mode that people are (rightly) being encouraged to use? Really asking... maybe the answer is "no", in which case this can be solved by documentation. But making the user factory definition work with these tests in strict mode seems like a kindness that people would appreciate. |
It adds everything it needs by default, it's up to you to update it based on your needs, not everyone needs teams, twofactor auth, or profile photos, that's why i think it isn't included, and you must activate thos features manually, by uncommenting the corresponding feature on |
Adding these to the user factory definition allows the tests to pass: 'current_team_id' => null,
'profile_photo_path' => null,
'two_factor_secret' => null,
'two_factor_confirmed_at' => null,
'two_factor_recovery_codes' => null, |
I haven't activated these features. The only thing I did after a bog-standard Laravel and Jetstream (Livewire) install was add the one line to activate strict mode. Further, the migrations to create the columns for these features are created by Jetstream regardless, so it seems reasonable to have the default user factory include defaults for these columns, even if you're not using the underlying features that they power. If someone not using these features calls |
I believe this could also be fixed in the tests themselves. Adding @markjaquith Your factory additions solve this issue as well, but could allow |
Description:
Errors regarding teams when running tests. For example:
or
Steps To Reproduce:
sail bin pest --filter "test_confirm_password_screen_can_be_rendered"
The text was updated successfully, but these errors were encountered: