Skip to content

Commit a2eb5d6

Browse files
committed
Update test
1 parent fe3faab commit a2eb5d6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/Traits/HomeControllerTest.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,21 @@ public function testHomeRoute(): void
2424
{
2525
$shop = factory($this->model)->create(['name' => 'shop-name.myshopify.com']);
2626

27-
$this->call('get', '/', ['token' => $this->buildToken()])
27+
$host = base64_encode($shop->getDomain()->toNative().'/admin');
28+
$this->call('get', '/', ['token' => $this->buildToken(), 'host' => $host])
2829
->assertOk()
2930
->assertSee('apiKey: "'.Util::getShopifyConfig('api_key').'"', false)
30-
->assertSee("shopOrigin: \"{$shop->name}\"", false);
31+
->assertSee("host: \"{$host}\"", false);
32+
}
33+
34+
public function testHomeRouteHostAdmin(): void
35+
{
36+
$shop = factory($this->model)->create(['name' => 'shop-name.myshopify.com']);
37+
38+
$host = base64_encode('admin.shopify.com/store/shop-name');
39+
$this->call('get', '/', ['token' => $this->buildToken(), 'host' => $host])
40+
->assertOk()
41+
->assertSee('apiKey: "'.Util::getShopifyConfig('api_key').'"', false)
42+
->assertSee("host: \"{$host}\"", false);
3143
}
3244
}

0 commit comments

Comments
 (0)