Skip to content

Commit

Permalink
Update the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyon147 committed Nov 11, 2024
1 parent 90eb73e commit c9690ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/resources/views/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

<title>{{ \Osiset\ShopifyApp\Util::getShopifyConfig('app_name') }}</title>

<meta name="shopify-api-key"
content="{{ \Osiset\ShopifyApp\Util::getShopifyConfig('api_key', $shopDomain ?? Auth::user()->name ) }}"/>
<meta name="shopify-api-key" content="{{ \Osiset\ShopifyApp\Util::getShopifyConfig('api_key', $shopDomain ?? Auth::user()->name ) }}"/>
<script src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>

@yield('styles')
Expand Down
10 changes: 4 additions & 6 deletions tests/Traits/HomeControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,18 @@ public function testHomeRoute(): void
$shop = factory($this->model)->create(['name' => 'shop-name.myshopify.com']);

$host = base64_encode($shop->getDomain()->toNative().'/admin');
$this->call('get', '/', ['token' => $this->buildToken(), 'host' => $host])
$this->call('get', '/', ['id_token' => $this->buildToken(), 'host' => $host])
->assertOk()
->assertSee('apiKey: "'.Util::getShopifyConfig('api_key').'"', false)
->assertSee("host: \"{$host}\"", false);
->assertSee('name="shopify-api-key" content="'.Util::getShopifyConfig('api_key').'"', false);
}

public function testHomeRouteHostAdmin(): void
{
$shop = factory($this->model)->create(['name' => 'shop-name.myshopify.com']);

$host = base64_encode('admin.shopify.com/store/shop-name');
$this->call('get', '/', ['token' => $this->buildToken(), 'host' => $host])
$this->call('get', '/', ['id_token' => $this->buildToken(), 'host' => $host])
->assertOk()
->assertSee('apiKey: "'.Util::getShopifyConfig('api_key').'"', false)
->assertSee("host: \"{$host}\"", false);
->assertSee('name="shopify-api-key" content="'.Util::getShopifyConfig('api_key').'"', false);
}
}

0 comments on commit c9690ce

Please sign in to comment.