-
-
Notifications
You must be signed in to change notification settings - Fork 642
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
Migrate BrowserKit tests to HTTP tests #984
Conversation
@joedixon could you make a quick review on the AdminTest migration before I start migrate all other test cases? Basically I've updated
About the first point would you prefer use assertRedirectTo($uri) instead of assertRedirectToRoute? Thanks. |
Great work @fabiorodriguesroque, thank you! All looks good to me. I don't think I'm particularly bothered if you use |
@fabiorodriguesroque thanks a bunch for this! I agree with @joedixon and think |
Yes! I got your point, the AdminTest was already updated with the |
I've updated almost all tests with exception of AuthTest, ForumTest and SettingsTest, where I think I need to use Laravel Dusk. for example test('users can register', function () {
Notification::fake();
session(['githubData' => ['id' => 123, 'username' => 'johndoe']]);
$this->visit('/register')
->type('John Doe', 'name')
->type('john.doe@example.com', 'email')
->type('johndoe', 'username')
->check('rules')
->check('terms')
->press('Register')
->seePageIs('/user/johndoe')
->see('John Doe');
assertLoggedIn();
$this->assertSessionMissing('githubData');
Notification::assertSentTo(Auth::user(), VerifyEmail::class);
}); Should I add the laravel/dusk dependency?? otherwise we can't migrate all use cases. |
Wonder if we can migrate this one to just a HTTP test. I think we only need to migrate this part, yes?
Skip the last part and migrate |
Yes, I think an HTTP test is fine here too 👍 |
yes, the only thing here is the functions like I've migrated the SettingsTest with actingAs($user) and updated the |
This is exactly what I had in mind, thank you! |
Hey @fabiorodriguesroque. Anything we can do to help get this PR over the finish line? We really appreciate this one! :) |
Yes @driesvints first of all sorry for not giving any news for a long time, but I'v been a little busy! I will commit and open a review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is totally awesome @fabiorodriguesroque, thank you 🙌
Amazing work @fabiorodriguesroque. Really appreciate this. Thanks! |
Seems for some reason we did miss the SubscriptionsTest here. Not sure what went wrong and how tests could pass 🤔 |
Weird! I was to take a look on this, but noticed you already migrate that one and deleted the BrowserKitTestCase, my bad. Thanks. |
Yeah just pushed it. No worries. The test suite should have caught this so no idea why it didn't. |
Tests to migrate