Skip to content

Commit

Permalink
Trying to see what happens in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
afonic committed May 12, 2024
1 parent 2742da9 commit eb98726
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/Feature/HooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,27 @@ protected function makePosts()
}

/** @test */
// public function it_can_hook_into_livewire_fetched_entries()
// {
// $this->withFakeViews();
public function it_can_hook_into_livewire_fetched_entries()
{
$this->withFakeViews();

// $this->viewShouldReturnRaw('statamic-livewire-filters::livewire.livewire-collection', '<div>{{ entries }} {{ bands }} {{ /entries }}</div>');
$this->viewShouldReturnRaw('statamic-livewire-filters::livewire.livewire-collection', '<div>{{ entries }} {{ bands }} {{ /entries }}</div>');

// LivewireCollection::hook('livewire-fetched-entries', function ($entries, $next) {
// $entries->transform(function ($entry) {
// return $entry->set('bands', 'I Love Rush!');
// });
LivewireCollection::hook('livewire-fetched-entries', function ($entries, $next) {
$entries->transform(function ($entry) {
return $entry->set('bands', 'I Love Rush!');
});

// return $next($entries);
// });
return $next($entries);
});

// $params = [
// 'from' => 'music',
// 'title:is' => 'I Love Guitars',
// ];
$params = [
'from' => 'music',
'title:is' => 'I Love Guitars',
];

// Livewire::test(LivewireCollection::class, ['params' => $params])
// ->assertSee('I Love Rush!');
Livewire::test(LivewireCollection::class, ['params' => $params])
->assertSee('I Love Rush!');

// }
}
}
2 changes: 2 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ protected function setUp(): void
$this->preventSavingStacheItemsToDisk();
}

dd(resource_path('sites.yaml'));

// We changed the default sites setup but the tests assume defaults like the following.
File::put(resource_path('sites.yaml'), YAML::dump([
'en' => [
Expand Down

0 comments on commit eb98726

Please sign in to comment.