Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
timvandijck committed Apr 29, 2024
1 parent 9b2d46a commit 1a8a048
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Spatie\LaravelIgnition\ContextProviders\LaravelLivewireRequestContextProvider;
use Spatie\LaravelIgnition\Tests\TestClasses\FakeLivewireManager;

beforeEach(function () {
$this->livewireManager = FakeLivewireManager::setUp();
$this->livewireManager = resolve(FakeLivewireManager::class);
})->skip(LIVEWIRE_VERSION_2, 'Only test Livewire 3.');

it('returns the referer url and method', function () {
Expand All @@ -24,7 +25,7 @@
$alias = 'fake-component';
$class = 'fake-class';

resolve(FakeLivewireManager::class)->addAlias($alias, $class);
$this->livewireManager->addAlias($alias, $class);

$context = createRequestContext([
'path' => 'http://localhost/referred',
Expand Down Expand Up @@ -166,5 +167,5 @@ function createRequestContext(array $fingerprint, array $updates = [], array $se
'updates' => $updates,
], ['X-Livewire' => 1]);

return new LaravelLivewireRequestContextProvider($providedRequest, new FakeLivewireManager());
return new LaravelLivewireRequestContextProvider($providedRequest, test()->livewireManager);
}

0 comments on commit 1a8a048

Please sign in to comment.