Skip to content

Commit f6a56f3

Browse files
committed
wait
1 parent c3741ea commit f6a56f3

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

src/Turbo/tests/BroadcastTest.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ protected function setUp(): void
3535

3636
public function testBroadcastBasic(): void
3737
{
38-
($client = self::createPantherClient())->request('GET', '/books');
38+
$client = self::createPantherClient();
39+
$client->wait();
40+
41+
$client->request('GET', '/books');
3942
$client->wait();
4043

4144
$crawler = $client->submitForm('Submit', ['title' => self::BOOK_TITLE]);
@@ -55,7 +58,10 @@ public function testBroadcastBasic(): void
5558

5659
public function testExpressionLanguageBroadcast(): void
5760
{
58-
($client = self::createPantherClient())->request('GET', '/artists');
61+
$client = self::createPantherClient();
62+
$client->wait();
63+
64+
$client->request('GET', '/artists');
5965
$client->wait();
6066

6167
$client->submitForm('Submit', ['name' => self::ARTIST_NAME_1]);
@@ -74,10 +80,14 @@ public function testExpressionLanguageBroadcast(): void
7480
$artist1Id = $matches[1][0];
7581
$artist2Id = $matches[1][1];
7682

77-
($clientArtist1 = self::createAdditionalPantherClient())->request('GET', '/artists/'.$artist1Id);
83+
$clientArtist1 = self::createAdditionalPantherClient();
84+
$clientArtist1->wait();
85+
$clientArtist1->request('GET', '/artists/'.$artist1Id);
7886
$clientArtist1->wait();
7987

80-
($clientArtist2 = self::createAdditionalPantherClient())->request('GET', '/artists/'.$artist2Id);
88+
$clientArtist2 = self::createAdditionalPantherClient();
89+
$clientArtist2->wait();
90+
$clientArtist2->request('GET', '/artists/'.$artist2Id);
8191
$clientArtist2->wait();
8292

8393
$client->request('GET', '/songs');
@@ -97,8 +107,11 @@ public function testExpressionLanguageBroadcast(): void
97107

98108
public function testBroadcastWithProxy(): void
99109
{
110+
$client = self::createPantherClient();
111+
$client->wait();
112+
100113
// testing that Artist is updated, even though it's saved as Proxy
101-
($client = self::createPantherClient())->request('GET', '/artistFromSong');
114+
$client->request('GET', '/artistFromSong');
102115
$client->wait();
103116

104117
// submit first time to create the artist

src/Turbo/tests/TurboFrameTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ class TurboFrameTest extends PantherTestCase
2020
{
2121
public function testFrame(): void
2222
{
23-
($client = self::createPantherClient())->request('GET', '/');
23+
$client = self::createPantherClient();
24+
$client->wait();
25+
26+
$client->request('GET', '/');
2427

2528
$client->clickLink('This block is scoped, the rest of the page will not change if you click here!');
2629
$this->assertSelectorWillContain('body', 'This will replace the content of the Turbo Frame!');

src/Turbo/tests/TurboStreamTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ final class TurboStreamTest extends PantherTestCase
2020
{
2121
public function testStream(): void
2222
{
23-
($client = self::createPantherClient())->request('GET', '/');
23+
$client = self::createPantherClient();
24+
$client->wait();
25+
26+
$client->request('GET', '/');
2427

2528
$client->submitForm('Trigger Turbo Stream!');
2629
$this->assertSelectorWillContain('body', 'This div replaces the existing element with the DOM ID "form".');

0 commit comments

Comments
 (0)