Skip to content

Commit

Permalink
assertions for defer + merge tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joetannenbaum committed Oct 3, 2024
1 parent 22b22cd commit 9b26d03
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public function test_server_response_with_deferred_prop(): void
$this->assertSame('Jonathan', $page['props']['user']['name']);
$this->assertSame('/user/123', $page['url']);
$this->assertSame('123', $page['version']);
$this->assertSame([
'default' => ['foo'],
], $page['deferredProps']);
$this->assertFalse($page['clearHistory']);
$this->assertFalse($page['encryptHistory']);
$this->assertSame('<div id="app" data-page="{&quot;component&quot;:&quot;User\/Edit&quot;,&quot;props&quot;:{&quot;user&quot;:{&quot;name&quot;:&quot;Jonathan&quot;}},&quot;url&quot;:&quot;\/user\/123&quot;,&quot;version&quot;:&quot;123&quot;,&quot;clearHistory&quot;:false,&quot;encryptHistory&quot;:false,&quot;deferredProps&quot;:{&quot;default&quot;:[&quot;foo&quot;]}}"></div>', $view->render());
Expand Down Expand Up @@ -118,6 +121,10 @@ public function test_server_response_with_deferred_prop_and_multiple_groups(): v
$this->assertSame('Jonathan', $page['props']['user']['name']);
$this->assertSame('/user/123', $page['url']);
$this->assertSame('123', $page['version']);
$this->assertSame([
'default' => ['foo', 'bar'],
'custom' => ['baz'],
], $page['deferredProps']);
$this->assertFalse($page['clearHistory']);
$this->assertFalse($page['encryptHistory']);
$this->assertSame('<div id="app" data-page="{&quot;component&quot;:&quot;User\/Edit&quot;,&quot;props&quot;:{&quot;user&quot;:{&quot;name&quot;:&quot;Jonathan&quot;}},&quot;url&quot;:&quot;\/user\/123&quot;,&quot;version&quot;:&quot;123&quot;,&quot;clearHistory&quot;:false,&quot;encryptHistory&quot;:false,&quot;deferredProps&quot;:{&quot;default&quot;:[&quot;foo&quot;,&quot;bar&quot;],&quot;custom&quot;:[&quot;baz&quot;]}}"></div>', $view->render());
Expand Down Expand Up @@ -149,6 +156,10 @@ public function test_server_response_with_merge_props(): void
$this->assertSame('Jonathan', $page['props']['user']['name']);
$this->assertSame('/user/123', $page['url']);
$this->assertSame('123', $page['version']);
$this->assertSame([
'foo',
'bar',
], $page['mergeProps']);
$this->assertFalse($page['clearHistory']);
$this->assertFalse($page['encryptHistory']);
$this->assertSame('<div id="app" data-page="{&quot;component&quot;:&quot;User\/Edit&quot;,&quot;props&quot;:{&quot;user&quot;:{&quot;name&quot;:&quot;Jonathan&quot;},&quot;foo&quot;:&quot;foo value&quot;,&quot;bar&quot;:&quot;bar value&quot;},&quot;url&quot;:&quot;\/user\/123&quot;,&quot;version&quot;:&quot;123&quot;,&quot;clearHistory&quot;:false,&quot;encryptHistory&quot;:false,&quot;mergeProps&quot;:[&quot;foo&quot;,&quot;bar&quot;]}"></div>', $view->render());
Expand Down Expand Up @@ -182,6 +193,13 @@ public function test_server_response_with_defer_and_merge_props(): void
$this->assertSame('Jonathan', $page['props']['user']['name']);
$this->assertSame('/user/123', $page['url']);
$this->assertSame('123', $page['version']);
$this->assertSame([
'default' => ['foo'],
], $page['deferredProps']);
$this->assertSame([
'foo',
'bar',
], $page['mergeProps']);
$this->assertFalse($page['clearHistory']);
$this->assertFalse($page['encryptHistory']);
$this->assertSame('<div id="app" data-page="{&quot;component&quot;:&quot;User\/Edit&quot;,&quot;props&quot;:{&quot;user&quot;:{&quot;name&quot;:&quot;Jonathan&quot;},&quot;bar&quot;:&quot;bar value&quot;},&quot;url&quot;:&quot;\/user\/123&quot;,&quot;version&quot;:&quot;123&quot;,&quot;clearHistory&quot;:false,&quot;encryptHistory&quot;:false,&quot;mergeProps&quot;:[&quot;foo&quot;,&quot;bar&quot;],&quot;deferredProps&quot;:{&quot;default&quot;:[&quot;foo&quot;]}}"></div>', $view->render());
Expand Down

0 comments on commit 9b26d03

Please sign in to comment.