I figured it out, turns out I need to decrypt the two_factor_secrete then use it to generate the code.
test('confirm 2FA', function () {
$user = User::factory()->create([
'password' => Hash::make('Password1#'),
]);
// Confirm User Password with Fortify route
$this->actingAs($user)->post('/user/confirm-password', [
'password' => 'Password1#',
]);
// Activate 2FA
$this->actingAs($user)->post('/user/two-factor-authentication');
$decryptedSecret = Crypt::decrypt($user->two_factor_secret);
// Initialize Google2FA
$google2fa = new Google2FA;
$otp = $google2fa->getCurrentOtp($decryptedSecret);
$response = $this->actingAs($user)->post('/user/confirmed-two-factor-authentication', [
'code' => $otp,
]);
$response->assertStatus(302);
$this->assertEquals(session('status'), 'two-factor-authentication-confirmed');
$user->refresh();
$this->assertNotNull($user->two_factor_confirmed_at);
});